<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width, initial-scale=0.8"/><title>5&nbsp;Advanced Student</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_0&quot;);">&#9660;</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x"><span style="font-style: italic">How to Design Programs</span> Languages</a></td></tr></table></div><div class="tocviewsublisttop" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="beginner.html" class="tocviewlink" data-pltdoc="x">Beginning Student</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="beginner-abbr.html" class="tocviewlink" data-pltdoc="x">Beginning Student with List Abbreviations</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="intermediate.html" class="tocviewlink" data-pltdoc="x">Intermediate Student</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="intermediate-lam.html" class="tocviewlink" data-pltdoc="x">Intermediate Student with Lambda</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">Advanced Student</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_1&quot;);">&#9658;</a></td><td>5&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">Advanced Student</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">5.1&nbsp;</td><td><a href="#%28part._advanced._.Pre-.Defined._.Variables%29" class="tocviewlink" data-pltdoc="x">Pre-<wbr></wbr>defined Variables</a></td></tr><tr><td align="right">5.2&nbsp;</td><td><a href="#%28part._advanced._.Template._.Variables%29" class="tocviewlink" data-pltdoc="x">Template Variables</a></td></tr><tr><td align="right">5.3&nbsp;</td><td><a href="#%28part._advanced-syntax%29" class="tocviewlink" data-pltdoc="x">Syntax for Advanced</a></td></tr><tr><td align="right">5.4&nbsp;</td><td><a href="#%28part._advanced-common-syntax%29" class="tocviewlink" data-pltdoc="x">Common Syntaxes</a></td></tr><tr><td align="right">5.5&nbsp;</td><td><a href="#%28part._advanced-pre-defined%29" class="tocviewlink" data-pltdoc="x">Pre-<wbr></wbr>Defined Functions</a></td></tr><tr><td align="right">5.6&nbsp;</td><td><a href="#%28part._htdp-advanced._.Numbers__.Integers__.Rationals__.Reals__.Complex__.Exacts__.Inexacts%29" class="tocviewlink" data-pltdoc="x">Numbers:<span class="mywbr"> &nbsp;</span> Integers, Rationals, Reals, Complex, Exacts, Inexacts</a></td></tr><tr><td align="right">5.7&nbsp;</td><td><a href="#%28part._htdp-advanced._.Booleans%29" class="tocviewlink" data-pltdoc="x">Booleans</a></td></tr><tr><td align="right">5.8&nbsp;</td><td><a href="#%28part._htdp-advanced._.Symbols%29" class="tocviewlink" data-pltdoc="x">Symbols</a></td></tr><tr><td align="right">5.9&nbsp;</td><td><a href="#%28part._htdp-advanced._.Lists%29" class="tocviewlink" data-pltdoc="x">Lists</a></td></tr><tr><td align="right">5.10&nbsp;</td><td><a href="#%28part._htdp-advanced._.Posns%29" class="tocviewlink" data-pltdoc="x">Posns</a></td></tr><tr><td align="right">5.11&nbsp;</td><td><a href="#%28part._htdp-advanced._.Characters%29" class="tocviewlink" data-pltdoc="x">Characters</a></td></tr><tr><td align="right">5.12&nbsp;</td><td><a href="#%28part._htdp-advanced._.Strings%29" class="tocviewlink" data-pltdoc="x">Strings</a></td></tr><tr><td align="right">5.13&nbsp;</td><td><a href="#%28part._htdp-advanced._.Images%29" class="tocviewlink" data-pltdoc="x">Images</a></td></tr><tr><td align="right">5.14&nbsp;</td><td><a href="#%28part._htdp-advanced._.Misc%29" class="tocviewlink" data-pltdoc="x">Misc</a></td></tr><tr><td align="right">5.15&nbsp;</td><td><a href="#%28part._htdp-advanced._.Numbers__relaxed_conditions_%29" class="tocviewlink" data-pltdoc="x">Numbers (relaxed conditions)</a></td></tr><tr><td align="right">5.16&nbsp;</td><td><a href="#%28part._htdp-advanced._.String__relaxed_conditions_%29" class="tocviewlink" data-pltdoc="x">String (relaxed conditions)</a></td></tr><tr><td align="right">5.17&nbsp;</td><td><a href="#%28part._htdp-advanced._.Posn%29" class="tocviewlink" data-pltdoc="x">Posn</a></td></tr><tr><td align="right">5.18&nbsp;</td><td><a href="#%28part._htdp-advanced._.Higher-.Order_.Functions%29" class="tocviewlink" data-pltdoc="x">Higher-<wbr></wbr>Order Functions</a></td></tr><tr><td align="right">5.19&nbsp;</td><td><a href="#%28part._htdp-advanced._.Reading_and_.Printing%29" class="tocviewlink" data-pltdoc="x">Reading and Printing</a></td></tr><tr><td align="right">5.20&nbsp;</td><td><a href="#%28part._htdp-advanced._.Vectors%29" class="tocviewlink" data-pltdoc="x">Vectors</a></td></tr><tr><td align="right">5.21&nbsp;</td><td><a href="#%28part._htdp-advanced._.Boxes%29" class="tocviewlink" data-pltdoc="x">Boxes</a></td></tr><tr><td align="right">5.22&nbsp;</td><td><a href="#%28part._htdp-advanced._.Hash_.Tables%29" class="tocviewlink" data-pltdoc="x">Hash Tables</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">5.1<tt>&nbsp;</tt></span><a href="#%28part._advanced._.Pre-.Defined._.Variables%29" class="tocsubseclink" data-pltdoc="x">Pre-<wbr></wbr>defined Variables</a></td></tr><tr><td><a href="#%28def._%28%28lib._lang%2Fhtdp-advanced..rkt%29._empty%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">empty</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._lang%2Fhtdp-advanced..rkt%29._true%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">true</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._lang%2Fhtdp-advanced..rkt%29._false%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">false</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.2<tt>&nbsp;</tt></span><a href="#%28part._advanced._.Template._.Variables%29" class="tocsubseclink" data-pltdoc="x">Template Variables</a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._....%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">..</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._......%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktMeta"><span class="RktStxLink">...</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._........%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">....</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._..........%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">.....</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._............%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">......</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.3<tt>&nbsp;</tt></span><a href="#%28part._advanced-syntax%29" class="tocsubseclink" data-pltdoc="x">Syntax for Advanced</a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._lambda%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">lambda</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~ce~bb%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">&#955;</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-datatype%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">define-<wbr></wbr>datatype</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._begin%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">begin</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._begin0%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">begin0</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._set%21%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">set!</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._delay%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">delay</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._shared%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">shared</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._recur%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">recur</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._case%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">case</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._match%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">match</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._when%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">when</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._unless%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">unless</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.4<tt>&nbsp;</tt></span><a href="#%28part._advanced-common-syntax%29" class="tocsubseclink" data-pltdoc="x">Common Syntaxes</a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._local%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">local</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._letrec%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">letrec</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._let%2A%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">let*</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._let%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">let</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._time%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">time</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">define</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-struct%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">define-<wbr></wbr>struct</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cond%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">cond</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._else%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">else</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._if%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">if</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._and%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">and</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._or%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">or</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-expect%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">check-<wbr></wbr>expect</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-random%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">check-<wbr></wbr>random</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-satisfied%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">check-<wbr></wbr>satisfied</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-within%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">check-<wbr></wbr>within</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-error%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">check-<wbr></wbr>error</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-member-of%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">check-<wbr></wbr>member-<wbr></wbr>of</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-range%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">check-<wbr></wbr>range</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._require%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">require</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.5<tt>&nbsp;</tt></span><a href="#%28part._advanced-pre-defined%29" class="tocsubseclink" data-pltdoc="x">Pre-<wbr></wbr>Defined Functions</a></td></tr><tr><td><span class="tocsublinknumber">5.6<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Numbers__.Integers__.Rationals__.Reals__.Complex__.Exacts__.Inexacts%29" class="tocsubseclink" data-pltdoc="x">Numbers:<span class="mywbr"> &nbsp;</span> Integers, Rationals, Reals, Complex, Exacts, Inexacts</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._-%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink"><span class="nobreak">-</span></span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~3c%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">&lt;</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~3c~3d%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">&lt;=</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~3d%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">=</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~3e%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">&gt;</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~3e~3d%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">&gt;=</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._abs%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">abs</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._acos%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">acos</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._add1%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">add1</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._angle%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">angle</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._asin%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">asin</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._atan%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">atan</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._ceiling%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">ceiling</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._complex~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">complex?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._conjugate%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">conjugate</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cos%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cos</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cosh%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cosh</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._current-seconds%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>seconds</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._denominator%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">denominator</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._e%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">e</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._even~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">even?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._exact-~3einexact%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">exact-<wbr></wbr>&gt;inexact</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._exact~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">exact?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._exp%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">exp</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._expt%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">expt</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._floor%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">floor</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._gcd%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">gcd</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._imag-part%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">imag-<wbr></wbr>part</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._inexact-~3eexact%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">inexact-<wbr></wbr>&gt;exact</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._inexact~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">inexact?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._integer-~3echar%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">integer-<wbr></wbr>&gt;char</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._integer-sqrt%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">integer-<wbr></wbr>sqrt</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._integer~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">integer?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._lcm%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">lcm</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._log%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">log</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._magnitude%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">magnitude</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-polar%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>polar</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-rectangular%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>rectangular</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._max%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">max</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._min%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">min</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._modulo%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">modulo</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._negative~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">negative?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._number-~3estring%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">number-<wbr></wbr>&gt;string</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._number~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">number?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._numerator%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">numerator</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._odd~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">odd?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._pi%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">pi</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._positive~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">positive?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._quotient%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">quotient</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._random%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">random</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._rational~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">rational?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._real-part%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">real-<wbr></wbr>part</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._real~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">real?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._remainder%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">remainder</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._round%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">round</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sgn%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sgn</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sin%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sin</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sinh%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sinh</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sqr%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sqr</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sqrt%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sqrt</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sub1%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sub1</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._tan%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">tan</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._zero~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">zero?</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.7<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Booleans%29" class="tocsubseclink" data-pltdoc="x">Booleans</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._boolean-~3estring%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">boolean-<wbr></wbr>&gt;string</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._boolean~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">boolean=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._boolean~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">boolean?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._false~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">false?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._not%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">not</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.8<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Symbols%29" class="tocsubseclink" data-pltdoc="x">Symbols</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._symbol-~3estring%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">symbol-<wbr></wbr>&gt;string</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._symbol~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">symbol=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._symbol~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">symbol?</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.9<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Lists%29" class="tocsubseclink" data-pltdoc="x">Lists</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._append%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">append</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._assoc%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">assoc</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._assq%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">assq</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._caaar%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">caaar</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._caadr%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">caadr</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._caar%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">caar</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cadar%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cadar</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cadddr%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cadddr</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._caddr%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">caddr</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cadr%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cadr</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._car%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">car</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cdaar%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cdaar</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cdadr%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cdadr</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cdar%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cdar</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cddar%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cddar</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cdddr%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cdddr</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cddr%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cddr</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cdr%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cdr</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cons%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cons</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cons~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">cons?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._eighth%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">eighth</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._empty~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">empty?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._fifth%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">fifth</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._first%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">first</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._fourth%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">fourth</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._length%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">length</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">list</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list%2A%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">list*</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list-ref%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">list-<wbr></wbr>ref</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">list?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-list%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>list</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._member%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">member</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._member~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">member?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._memq%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">memq</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._memq~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">memq?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._memv%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">memv</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._null%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">null</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._null~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">null?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._range%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">range</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._remove%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">remove</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._remove-all%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">remove-<wbr></wbr>all</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._rest%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">rest</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._reverse%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">reverse</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._second%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">second</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._seventh%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">seventh</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sixth%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sixth</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._third%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">third</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.10<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Posns%29" class="tocsubseclink" data-pltdoc="x">Posns</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-posn%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>posn</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._posn-x%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">posn-<wbr></wbr>x</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._posn-y%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">posn-<wbr></wbr>y</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._posn~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">posn?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._set-posn-x%21%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">set-<wbr></wbr>posn-<wbr></wbr>x!</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._set-posn-y%21%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">set-<wbr></wbr>posn-<wbr></wbr>y!</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.11<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Characters%29" class="tocsubseclink" data-pltdoc="x">Characters</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-~3einteger%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char-<wbr></wbr>&gt;integer</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-alphabetic~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char-<wbr></wbr>alphabetic?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-ci~3c~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char-<wbr></wbr>ci&lt;=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-ci~3c~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char-<wbr></wbr>ci&lt;?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-ci~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char-<wbr></wbr>ci=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-ci~3e~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char-<wbr></wbr>ci&gt;=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-ci~3e~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char-<wbr></wbr>ci&gt;?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-downcase%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char-<wbr></wbr>downcase</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-lower-case~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char-<wbr></wbr>lower-<wbr></wbr>case?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-numeric~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char-<wbr></wbr>numeric?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-upcase%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char-<wbr></wbr>upcase</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-upper-case~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char-<wbr></wbr>upper-<wbr></wbr>case?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-whitespace~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char-<wbr></wbr>whitespace?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char~3c~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char&lt;=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char~3c~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char&lt;?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char~3e~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char&gt;=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char~3e~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char&gt;?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">char?</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.12<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Strings%29" class="tocsubseclink" data-pltdoc="x">Strings</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._explode%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">explode</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._format%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">format</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._implode%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">implode</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._int-~3estring%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">int-<wbr></wbr>&gt;string</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list-~3estring%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">list-<wbr></wbr>&gt;string</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-string%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>string</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._replicate%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">replicate</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-~3eint%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>&gt;int</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-~3elist%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>&gt;list</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-~3enumber%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>&gt;number</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-~3esymbol%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>&gt;symbol</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-alphabetic~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>alphabetic?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-contains-ci~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>contains-<wbr></wbr>ci?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-contains~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>contains?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-copy%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>copy</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-downcase%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>downcase</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ith%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>ith</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-length%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>length</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-lower-case~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>lower-<wbr></wbr>case?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-numeric~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>numeric?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ref%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>ref</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-upcase%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>upcase</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-upper-case~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>upper-<wbr></wbr>case?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-whitespace~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>whitespace?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._substring%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">substring</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.13<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Images%29" class="tocsubseclink" data-pltdoc="x">Images</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._image~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">image=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._image~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">image?</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.14<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Misc%29" class="tocsubseclink" data-pltdoc="x">Misc</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~3d~7e%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">=~</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._current-milliseconds%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>milliseconds</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._eof%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">eof</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._eof-object~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">eof-<wbr></wbr>object?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._eq~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">eq?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._equal~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">equal?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._equal~7e~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">equal~?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._eqv~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">eqv?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._error%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">error</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._exit%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">exit</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._force%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">force</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._gensym%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">gensym</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._identity%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">identity</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._promise~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">promise?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sleep%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sleep</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._struct~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">struct?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._void%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">void</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._void~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">void?</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.15<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Numbers__relaxed_conditions_%29" class="tocsubseclink" data-pltdoc="x">Numbers (relaxed conditions)</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._%2A%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">*</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._%2B%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">+</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._%2F%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">/</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.16<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.String__relaxed_conditions_%29" class="tocsubseclink" data-pltdoc="x">String (relaxed conditions)</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-append%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>append</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ci~3c~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>ci&lt;=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ci~3c~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>ci&lt;?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ci~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>ci=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ci~3e~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>ci&gt;=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ci~3e~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string-<wbr></wbr>ci&gt;?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string~3c~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string&lt;=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string~3c~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string&lt;?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string~3e~3d~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string&gt;=?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string~3e~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">string&gt;?</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.17<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Posn%29" class="tocsubseclink" data-pltdoc="x">Posn</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._posn%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">posn</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.18<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Higher-.Order_.Functions%29" class="tocsubseclink" data-pltdoc="x">Higher-<wbr></wbr>Order Functions</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._andmap%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">andmap</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._apply%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">apply</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._argmax%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">argmax</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._argmin%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">argmin</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._build-list%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">build-<wbr></wbr>list</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._build-string%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">build-<wbr></wbr>string</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._compose%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">compose</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._filter%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">filter</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._foldl%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">foldl</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._foldr%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">foldr</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._map%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">map</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._memf%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">memf</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._ormap%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">ormap</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._procedure~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">procedure?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._quicksort%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">quicksort</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sort%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sort</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.19<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Reading_and_.Printing%29" class="tocsubseclink" data-pltdoc="x">Reading and Printing</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._display%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">display</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._newline%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">newline</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._pretty-print%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">pretty-<wbr></wbr>print</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._print%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">print</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._printf%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">printf</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._read%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">read</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._with-input-from-file%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">with-<wbr></wbr>input-<wbr></wbr>from-<wbr></wbr>file</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._with-input-from-string%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">with-<wbr></wbr>input-<wbr></wbr>from-<wbr></wbr>string</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._with-output-to-file%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">with-<wbr></wbr>output-<wbr></wbr>to-<wbr></wbr>file</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._with-output-to-string%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">with-<wbr></wbr>output-<wbr></wbr>to-<wbr></wbr>string</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._write%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">write</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.20<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Vectors%29" class="tocsubseclink" data-pltdoc="x">Vectors</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._build-vector%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">build-<wbr></wbr>vector</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list-~3evector%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">list-<wbr></wbr>&gt;vector</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-vector%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>vector</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">vector</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector-~3elist%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">vector-<wbr></wbr>&gt;list</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector-length%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">vector-<wbr></wbr>length</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector-ref%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">vector-<wbr></wbr>ref</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector-set%21%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">vector-<wbr></wbr>set!</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">vector?</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.21<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Boxes%29" class="tocsubseclink" data-pltdoc="x">Boxes</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._box%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">box</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._box~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">box?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._set-box%21%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">set-<wbr></wbr>box!</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._unbox%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">unbox</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.22<tt>&nbsp;</tt></span><a href="#%28part._htdp-advanced._.Hash_.Tables%29" class="tocsubseclink" data-pltdoc="x">Hash Tables</a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-copy%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>copy</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-count%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>count</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-eq~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>eq?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-equal~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>equal?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-eqv~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>eqv?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-for-each%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>for-<wbr></wbr>each</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-has-key~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>has-<wbr></wbr>key?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-map%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>map</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-ref%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>ref</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-ref%21%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>ref!</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-remove%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>remove</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-remove%21%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>remove!</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-set%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>set</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-set%21%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>set!</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-update%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>update</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-update%21%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>update!</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash?</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-hash%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>hash</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-hasheq%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>hasheq</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-hasheqv%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>hasheqv</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-immutable-hash%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>immutable-<wbr></wbr>hash</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-immutable-hasheq%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>immutable-<wbr></wbr>hasheq</span></span></a></td></tr><tr><td><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-immutable-hasheqv%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>immutable-<wbr></wbr>hasheqv</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" tabindex="1" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, &quot;7.7&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;7.7&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="intermediate-lam.html" title="backward to &quot;4 Intermediate Student with Lambda&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;How to Design Programs Languages&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<span class="nonavigation">next &rarr;</span></span>&nbsp;</div><h3 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-tag="&quot;advanced&quot;">5<tt>&nbsp;</tt><a name="(part._advanced)"></a><a name="(idx._(gentag._52._(lib._scribblings/htdp-langs/htdp-langs..scrbl)))"></a>Advanced Student</h3><p>The grammar notation uses the notation <span class="RktSym">X</span><span class="stt"> </span><span style="font-weight: bold">...</span> (bold
dots) to indicate that <span class="RktSym">X</span> may occur an arbitrary number of times
(zero, one, or more). Separately, the grammar also defines <span class="RktSym">...</span> as an
identifier to be used in templates.</p><p><table cellspacing="0" cellpadding="0"><tr><td align="right" valign="baseline"><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">program</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">def-or-expr</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td></tr><tr><td align="right" valign="baseline"><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">def-or-expr</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">definition</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">expr</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">test-case</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">library-require</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td></tr><tr><td align="right" valign="baseline"><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">definition</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">variable</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-struct%29%29" class="RktStxLink" data-pltdoc="x">define-struct</a></span><span class="hspace">&nbsp;</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-datatype%29%29" class="RktStxLink" data-pltdoc="x">define-datatype</a></span><span class="hspace">&nbsp;</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td></tr><tr><td align="right" valign="baseline"><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">expr</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._begin%29%29" class="RktStxLink" data-pltdoc="x">begin</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._begin0%29%29" class="RktStxLink" data-pltdoc="x">begin0</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._set%21%29%29" class="RktStxLink" data-pltdoc="x">set!</a></span><span class="hspace">&nbsp;</span><span class="RktVar">variable</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._delay%29%29" class="RktStxLink" data-pltdoc="x">delay</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">variable</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">&#955;</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">variable</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._local%29%29" class="RktStxLink" data-pltdoc="x">local</a></span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktVar">definition</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._letrec%29%29" class="RktStxLink" data-pltdoc="x">letrec</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._shared%29%29" class="RktStxLink" data-pltdoc="x">shared</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span><span class="hspace">&nbsp;</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._let%2A%29%29" class="RktStxLink" data-pltdoc="x">let*</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._recur%29%29" class="RktStxLink" data-pltdoc="x">recur</a></span><span class="hspace">&nbsp;</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cond%29%29" class="RktStxLink" data-pltdoc="x">cond</a></span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cond%29%29" class="RktStxLink" data-pltdoc="x">cond</a></span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._case%29%29" class="RktStxLink" data-pltdoc="x">case</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">choice</span><span class="hspace">&nbsp;</span><span class="RktVar">choice</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">choice</span><span class="hspace">&nbsp;</span><span class="RktVar">choice</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._case%29%29" class="RktStxLink" data-pltdoc="x">case</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">choice</span><span class="hspace">&nbsp;</span><span class="RktVar">choice</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._match%29%29" class="RktStxLink" data-pltdoc="x">match</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktVar">pattern</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._when%29%29" class="RktStxLink" data-pltdoc="x">when</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._unless%29%29" class="RktStxLink" data-pltdoc="x">unless</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._and%29%29" class="RktStxLink" data-pltdoc="x">and</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._time%29%29" class="RktStxLink" data-pltdoc="x">time</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">name</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVal">&rsquo;</span><span class="RktVar">quoted</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVal">&lsquo;</span><span class="RktVar">quasiquoted</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVal">&rsquo;</span><span class="RktPn">(</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">number</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">boolean</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">string</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">character</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td></tr><tr><td align="right" valign="baseline"><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">choice</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">name</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">number</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td></tr><tr><td align="right" valign="baseline"><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">pattern</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktSym">_</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">name</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">number</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">true</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">false</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">string</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">character</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVal">&rsquo;</span><span class="RktVar">quoted</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVal">&lsquo;</span><span class="RktVar">quasiquoted-pattern</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cons%29%29" class="RktValLink" data-pltdoc="x">cons</a></span><span class="hspace">&nbsp;</span><span class="RktVar">pattern</span><span class="hspace">&nbsp;</span><span class="RktVar">pattern</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace">&nbsp;</span><span class="RktVar">pattern</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list%2A%29%29" class="RktValLink" data-pltdoc="x">list*</a></span><span class="hspace">&nbsp;</span><span class="RktVar">pattern</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym">struct</span><span class="hspace">&nbsp;</span><span class="RktVar">id</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">pattern</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector%29%29" class="RktValLink" data-pltdoc="x">vector</a></span><span class="hspace">&nbsp;</span><span class="RktVar">pattern</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._box%29%29" class="RktValLink" data-pltdoc="x">box</a></span><span class="hspace">&nbsp;</span><span class="RktVar">pattern</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td></tr><tr><td align="right" valign="baseline"><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">quasiquoted-pattern</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">name</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">number</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">string</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">character</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">quasiquoted-pattern</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVal">&rsquo;</span><span class="RktVar">quasiquoted-pattern</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVal">&lsquo;</span><span class="RktVar">quasiquoted-pattern</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">,</span><span class="RktVar">pattern</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">,@</span><span class="RktVar">pattern</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td></tr><tr><td align="right" valign="baseline"><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">quoted</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">name</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">number</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">string</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">character</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">quoted</span><span class="stt"> </span><span class="RktSym">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVal">&rsquo;</span><span class="RktVar">quoted</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVal">&lsquo;</span><span class="RktVar">quoted</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">,</span><span class="RktVar">quoted</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">,@</span><span class="RktVar">quoted</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td></tr><tr><td align="right" valign="baseline"><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">quasiquoted</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">name</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">number</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">string</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVar">character</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktVar">quasiquoted</span><span class="stt"> </span><span class="RktSym">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVal">&rsquo;</span><span class="RktVar">quasiquoted</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktVal">&lsquo;</span><span class="RktVar">quasiquoted</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">,</span><span class="RktSym">expr</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">,@</span><span class="RktSym">expr</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td></tr><tr><td align="right" valign="baseline"><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">test-case</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-expect%29%29" class="RktStxLink" data-pltdoc="x">check-expect</a></span><span class="stt"> </span><span class="RktSym">expr</span><span class="stt"> </span><span class="RktSym">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-random%29%29" class="RktStxLink" data-pltdoc="x">check-random</a></span><span class="stt"> </span><span class="RktSym">expr</span><span class="stt"> </span><span class="RktSym">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-within%29%29" class="RktStxLink" data-pltdoc="x">check-within</a></span><span class="stt"> </span><span class="RktSym">expr</span><span class="stt"> </span><span class="RktSym">expr</span><span class="stt"> </span><span class="RktSym">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-error%29%29" class="RktStxLink" data-pltdoc="x">check-error</a></span><span class="stt"> </span><span class="RktSym">expr</span><span class="stt"> </span><span class="RktSym">expr</span><span class="stt"> </span><span class="RktSym">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-member-of%29%29" class="RktStxLink" data-pltdoc="x">check-member-of</a></span><span class="stt"> </span><span class="RktSym">expr</span><span class="stt"> </span><span class="RktSym">expr</span><span class="stt"> </span><span class="RktSym">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-satisfied%29%29" class="RktStxLink" data-pltdoc="x">check-satisfied</a></span><span class="stt"> </span><span class="RktSym">expr</span><span class="stt"> </span><span class="RktVar">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-range%29%29" class="RktStxLink" data-pltdoc="x">check-range</a></span><span class="stt"> </span><span class="RktSym">expr</span><span class="stt"> </span><span class="RktSym">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-range%29%29" class="RktStxLink" data-pltdoc="x">check-range</a></span><span class="stt"> </span><span class="RktSym">expr</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td></tr><tr><td align="right" valign="baseline"><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">library-require</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="stt"> </span><span class="RktSym">string</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">lib</span><span class="stt"> </span><span class="RktSym">string</span><span class="stt"> </span><span class="RktSym">string</span><span class="stt"> </span><span class="RktSym">...</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">planet</span><span class="stt"> </span><span class="RktSym">string</span><span class="stt"> </span><span class="RktVar">package</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td></tr><tr><td align="right" valign="baseline"><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">package</span></td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt">&nbsp;</span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym">string</span><span class="stt"> </span><span class="RktSym">string</span><span class="stt"> </span><span class="RktSym">number</span><span class="stt"> </span><span class="RktSym">number</span><span class="RktPn">)</span></td></tr></table></p><p><div class="SIntrapara">A <span class="RktVar">name</span> or a <span class="RktVar">variable</span> is a sequence of characters
not including a space or one of the following:</div><div class="SIntrapara"><span class="hspace">&nbsp;&nbsp;</span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">"</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">,</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">'</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">`</span><span class="hspace"></span></span>
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">(</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span>
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span> <span class="RktInBG"><span class="hspace"></span><span class="RktIn">;</span><span class="hspace"></span></span>
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">#</span><span class="hspace"></span></span></div><div class="SIntrapara">A <span class="RktVar">number</span> is a number such as <span class="RktVal">123</span>, <span class="RktVal">3/2</span>, or
<span class="RktVal">5.5</span>.</div><div class="SIntrapara">A <span class="RktVar">boolean</span> is one of: <span class="RktVal">#true</span><span class="RktMeta"></span> or  <span class="RktVal">#false</span><span class="RktMeta"></span>.

Alternative spellings for the <span class="RktVal">#true</span><span class="RktMeta"></span> constant are <span class="RktVal">#t</span>,
<span class="RktSym">true</span>, and <span class="RktVal">#T</span><span class="RktMeta"></span>. Similarly, <span class="RktVal">#f</span><span class="RktMeta"></span>, <span class="RktSym">false</span>, or
<span class="RktVal">#F</span><span class="RktMeta"></span> are also recognized as <span class="RktVal">#false</span><span class="RktMeta"></span>.</div><div class="SIntrapara">A <span class="RktVar">symbol</span> is a quote character followed by a name. A
symbol is a value, just like <span class="RktVal">42</span><span class="RktMeta"></span>, <span class="RktVal">'</span><span class="RktPn">(</span><span class="RktPn">)</span><span class="RktMeta"></span>, or <span class="RktVal">#false</span><span class="RktMeta"></span>.</div><div class="SIntrapara">A <span class="RktVar">string</span> is a sequence of characters enclosed by a pair of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">"</span><span class="hspace"></span></span>. Unlike
symbols, strings may be split into characters and manipulated by a
variety of functions.  For example, <span class="RktVal">"abcdef"</span>,
<span class="RktVal">"This is a string"</span>, and <span class="RktVal">"This is a string with \" inside"</span> are all strings.</div><div class="SIntrapara">A <span class="RktVar">character</span> begins with <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#\</span><span class="hspace"></span></span> and has the
name of the character. For example, <span class="RktVal">#\a</span>, <span class="RktVal">#\b</span>,
and <span class="RktVal">#\space</span> are characters.</div><div class="SIntrapara">In <a href="#%28part._advanced-syntax%29" data-pltdoc="x">function calls</a>, the function appearing
immediately after the open parenthesis can be any functions defined
with <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span> or <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-struct%29%29" class="RktStxLink" data-pltdoc="x">define-struct</a></span>, or any one of the
<a href="#%28part._advanced-pre-defined%29" data-pltdoc="x">pre-defined functions</a>.</div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-tag="&quot;advanced Pre-Defined Variables&quot;">5.1<tt>&nbsp;</tt><a name="(part._advanced._.Pre-.Defined._.Variables)"></a>Pre-defined Variables</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._lang/htdp-advanced..rkt)._empty))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._lang%2Fhtdp-advanced..rkt%29._empty%29%29" class="RktValDef RktValLink" data-pltdoc="x">empty</a></span></span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._empty~3f%29%29" class="RktValLink" data-pltdoc="x">empty?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">The empty list.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._lang/htdp-advanced..rkt)._true))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._lang%2Fhtdp-advanced..rkt%29._true%29%29" class="RktValDef RktValLink" data-pltdoc="x">true</a></span></span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">The <span class="RktVal">#true</span><span class="RktMeta"></span> value.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._lang/htdp-advanced..rkt)._false))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._lang%2Fhtdp-advanced..rkt%29._false%29%29" class="RktValDef RktValLink" data-pltdoc="x">false</a></span></span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">The <span class="RktVal">#false</span><span class="RktMeta"></span> value.</div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-tag="&quot;advanced Template Variables&quot;">5.2<tt>&nbsp;</tt><a name="(part._advanced._.Template._.Variables)"></a>Template Variables</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><a name="(form._((lib._lang/htdp-advanced..rkt)._....))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._....%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">..</a></span></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A placeholder for indicating that a definition is a template.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><a name="(form._((lib._lang/htdp-advanced..rkt)._......))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktMeta"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._......%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">...</a></span></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A placeholder for indicating that a definition is a template.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><a name="(form._((lib._lang/htdp-advanced..rkt)._........))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._........%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">....</a></span></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A placeholder for indicating that a definition is a template.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><a name="(form._((lib._lang/htdp-advanced..rkt)._..........))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._..........%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">.....</a></span></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A placeholder for indicating that a definition is a template.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><a name="(form._((lib._lang/htdp-advanced..rkt)._............))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._............%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">......</a></span></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A placeholder for indicating that a definition is a template.</div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-tag="&quot;advanced-syntax&quot;">5.3<tt>&nbsp;</tt><a name="(part._advanced-syntax)"></a>Syntax for Advanced</h4><p>In Advanced, <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._set%21%29%29" class="RktStxLink" data-pltdoc="x">set!</a></span> can be used to mutate variables, and
<span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-struct%29%29" class="RktStxLink" data-pltdoc="x">define-struct</a></span>&rsquo;s structures are mutatable. <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span> and
<span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span> can define functions of zero arguments, and function calls can
invoke functions of zero arguments.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._lambda))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._lambda%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">lambda</a></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">variable</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Creates a function that takes as many arguments as given <span class="RktVar">variable</span>s,
and whose body is <span class="RktVar">expression</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._~ce~bb))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~ce~bb%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">&#955;</a></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">variable</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">The Greek letter <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">&#955;</a></span> is a synonym for <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Calls the function that results from evaluating the first
<span class="RktVar">expression</span>. The value of the call is the value of function&rsquo;s body when
every instance of <span class="RktSym">name</span>&rsquo;s variables are replaced by the values of the
corresponding <span class="RktVar">expression</span>s.</div></p><p>The function being called must come from either a definition appearing before the
function call, or from a <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span> expression. The number of argument
<span class="RktVar">expression</span>s must be the same as the number of arguments expected by
the function.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._define-datatype))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-datatype%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">define-datatype</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">dataype-name</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktVar">variant-name</span><span class="hspace">&nbsp;</span><span class="RktVar">field-name</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A short-hand for defining a group of related structures. The following <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-datatype%29%29" class="RktStxLink" data-pltdoc="x">define-datatype</a></span>:</div></p><p><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-datatype%29%29" class="RktStxLink" data-pltdoc="x">define-datatype</a></span><span class="hspace">&nbsp;</span><span class="RktSym">datatype-name</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktVar">variant-name</span><span class="hspace">&nbsp;</span><span class="RktVar">field-name</span><span class="hspace">&nbsp;</span><span class="RktSym">#, <span style="font-weight: bold">...</span></span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">...</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">is equivalent to:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">datatype-name</span><span class="RktSym">?</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">variant-name</span><span class="RktSym">?</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">...</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-struct%29%29" class="RktStxLink" data-pltdoc="x">define-struct</a></span><span class="hspace">&nbsp;</span><span class="RktVar">variant-name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">field-name</span><span class="hspace">&nbsp;</span><span class="RktSym">...</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktSym">...</span></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._begin))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._begin%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">begin</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Evaluates the <span class="RktVar">expression</span>s in order from left to right. The value of
the <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._begin%29%29" class="RktStxLink" data-pltdoc="x">begin</a></span> expression is the value of the last <span class="RktVar">expression</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._begin0))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._begin0%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">begin0</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Evaluates the <span class="RktVar">expression</span>s in order from left to right. The value of
the <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._begin%29%29" class="RktStxLink" data-pltdoc="x">begin</a></span> expression is the value of the first <span class="RktVar">expression</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._set!))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._set%21%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">set!</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">variable</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Evaluates <span class="RktVar">expression</span>, and then mutates the <span class="RktVar">variable</span>
to have <span class="RktVar">expression</span>&rsquo;s value. The <span class="RktVar">variable</span> must be defined
by <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span>, <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._letrec%29%29" class="RktStxLink" data-pltdoc="x">letrec</a></span>, <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._let%2A%29%29" class="RktStxLink" data-pltdoc="x">let*</a></span>, or <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._let%29%29" class="RktStxLink" data-pltdoc="x">let</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._delay))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._delay%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">delay</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Produces a &ldquo;promise&rdquo; to evaluate <span class="RktVar">expression</span>. The <span class="RktVar">expression</span>
is not evaluated until the promise is forced with <span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._force%29%29" class="RktValLink" data-pltdoc="x">force</a></span>; when
the promise is forced, the result is recorded, so that any further
<span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._force%29%29" class="RktValLink" data-pltdoc="x">force</a></span> of the promise immediately produces the remembered value.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._shared))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._shared%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">shared</a></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._letrec%29%29" class="RktStxLink" data-pltdoc="x">letrec</a></span>, but when an <span class="RktVar">expression</span> next to an <span class="RktSym">id</span>
is a <span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cons%29%29" class="RktValLink" data-pltdoc="x">cons</a></span>, <span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span>, <span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector%29%29" class="RktValLink" data-pltdoc="x">vector</a></span>, quasiquoted
expression, or <span class="RktSym">make-</span><span class="RktVar">struct-name</span> from a
<span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-struct%29%29" class="RktStxLink" data-pltdoc="x">define-struct</a></span>, the <span class="RktVar">expression</span> can refer directly to any
<span class="RktVar">name</span>, not just <span class="RktVar">name</span>s defined earlier. Thus,
<span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._shared%29%29" class="RktStxLink" data-pltdoc="x">shared</a></span> can be used to create cyclic data structures.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._recur))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._recur%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">recur</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A short-hand syntax for recursive loops. The first <span class="RktVar">name</span> corresponds to
the name of the recursive function. The <span class="RktVar">name</span>s in the parenthesis are
the function&rsquo;s arguments, and each corresponding <span class="RktVar">expression</span> is a
value supplied for that argument in an initial starting call of the
function. The last <span class="RktVar">expression</span> is the body of the function.</div></p><p>More precisely, the following <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._recur%29%29" class="RktStxLink" data-pltdoc="x">recur</a></span>:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._recur%29%29" class="RktStxLink" data-pltdoc="x">recur</a></span><span class="hspace">&nbsp;</span><span class="RktSym">func-name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">arg-name</span><span class="hspace">&nbsp;</span><span class="RktSym">arg-expression</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktSym">...</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">body-expression</span><span class="RktPn">)</span></td></tr></table></blockquote><p>is equivalent to:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._local%29%29" class="RktStxLink" data-pltdoc="x">local</a></span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">func-name</span><span class="hspace">&nbsp;</span><span class="RktSym">arg-name</span><span class="hspace">&nbsp;</span><span class="RktSym">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">body-expression</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">func-name</span><span class="hspace">&nbsp;</span><span class="RktSym">arg-expression</span><span class="hspace">&nbsp;</span><span class="RktSym">...</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><span class="RktVar">let</span><span class="hspace">&nbsp;</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">An alternate syntax for <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._recur%29%29" class="RktStxLink" data-pltdoc="x">recur</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._case))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._case%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">case</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">choice</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">choice</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">]</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._case%29%29" class="RktStxLink" data-pltdoc="x">case</a></span> form contains one or more clauses. Each clause contains a
choices (in parentheses)&#8212;<wbr></wbr>either numbers or names&#8212;<wbr></wbr>and an answer
<span class="RktVar">expression</span>. The initial <span class="RktVar">expression</span> is evaluated, and its
value is compared to the choices in each clause, where the lines are considered
in order. The first line that contains a matching choice provides an answer
<span class="RktVar">expression</span> whose value is the result of the whole <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._case%29%29" class="RktStxLink" data-pltdoc="x">case</a></span>
expression. Numbers match with the numbers in the choices, and symbols match
with the names. If none of the lines contains a matching choice, it is an
error.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._case%29%29" class="RktStxLink" data-pltdoc="x">case</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktVar">choice</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">]</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">This form of <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._case%29%29" class="RktStxLink" data-pltdoc="x">case</a></span> is similar to the prior one, except that the final
<span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</a></span> clause is taken if no clause contains a choice matching the value
of the initial <span class="RktVar">expression</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._match))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._match%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">match</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktVar">pattern</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span style="font-weight: bold">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._match%29%29" class="RktStxLink" data-pltdoc="x">match</a></span> form contains one or more clauses that are surrounded by
square brackets. Each clause contains a pattern&#8212;<wbr></wbr>a description of a value&#8212;<wbr></wbr>and
an answer <span class="RktVar">expression</span>.  The initial <span class="RktVar">expression</span> is evaluated,
and its value is matched against the pattern in each clause, where the clauses are
considered in order. The first clause that contains a matching pattern provides
an answer <span class="RktVar">expression</span> whose value is the result of the whole
<span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._match%29%29" class="RktStxLink" data-pltdoc="x">match</a></span> expression. This <span class="RktVar">expression</span> may reference identifiers
defined in the matching pattern. If none of the clauses contains a matching
pattern, it is an error.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._when))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._when%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">when</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">question-expression</span><span class="hspace">&nbsp;</span><span class="RktVar">body-expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">If <span class="RktVar">question-expression</span> evaluates to <span class="RktSym"><a href="#%28def._%28%28lib._lang%2Fhtdp-advanced..rkt%29._true%29%29" class="RktValLink" data-pltdoc="x">true</a></span>, the result of the
<span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._when%29%29" class="RktStxLink" data-pltdoc="x">when</a></span> expression is the result of evaluating the
<span class="RktVar">body-expression</span>, otherwise the result is <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._void%29%29" class="RktValLink" data-pltdoc="x">void</a></span><span class="RktPn">)</span> and the
<span class="RktVar">body-expression</span> is not evaluated. If the result of evaluating the
<span class="RktVar">question-expression</span> is neither <span class="RktSym"><a href="#%28def._%28%28lib._lang%2Fhtdp-advanced..rkt%29._true%29%29" class="RktValLink" data-pltdoc="x">true</a></span> nor <span class="RktSym"><a href="#%28def._%28%28lib._lang%2Fhtdp-advanced..rkt%29._false%29%29" class="RktValLink" data-pltdoc="x">false</a></span>, it is an
error.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._unless))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._unless%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">unless</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">question-expression</span><span class="hspace">&nbsp;</span><span class="RktVar">body-expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._when%29%29" class="RktStxLink" data-pltdoc="x">when</a></span>, but the <span class="RktVar">body-expression</span> is evaluated when the
<span class="RktVar">question-expression</span> produces <span class="RktSym"><a href="#%28def._%28%28lib._lang%2Fhtdp-advanced..rkt%29._false%29%29" class="RktValLink" data-pltdoc="x">false</a></span> instead of <span class="RktSym"><a href="#%28def._%28%28lib._lang%2Fhtdp-advanced..rkt%29._true%29%29" class="RktValLink" data-pltdoc="x">true</a></span>.</div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-tag="&quot;advanced-common-syntax&quot;">5.4<tt>&nbsp;</tt><a name="(part._advanced-common-syntax)"></a>Common Syntaxes</h4><p>The following syntaxes behave the same in the <span class="emph">Advanced</span>
level as they did in the <a href="intermediate-lam.html" data-pltdoc="x">Intermediate Student with Lambda</a> level.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._local))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._local%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">local</a></span></span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktVar">definition</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Groups related definitions for use in <span class="RktVar">expression</span>. Each
<span class="RktVar">definition</span> can be either a <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span> or a
<span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-struct%29%29" class="RktStxLink" data-pltdoc="x">define-struct</a></span>.</div></p><p><div class="SIntrapara">When evaluating <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._local%29%29" class="RktStxLink" data-pltdoc="x">local</a></span>, each <span class="RktVar">definition</span> is evaluated
in order, and finally the body <span class="RktVar">expression</span> is
evaluated. Only the expressions within the <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._local%29%29" class="RktStxLink" data-pltdoc="x">local</a></span> (including
the right-hand-sides of the <span class="RktVar">definition</span>s and the
<span class="RktVar">expression</span>) may refer to the names defined by the
<span class="RktVar">definition</span>s. If a name defined in the <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._local%29%29" class="RktStxLink" data-pltdoc="x">local</a></span> is the
same as a top-level binding, the inner one &ldquo;shadows&rdquo; the outer
one. That is, inside the <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._local%29%29" class="RktStxLink" data-pltdoc="x">local</a></span>, any references to that name
refer to the inner one.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._letrec))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._letrec%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">letrec</a></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expr-for-let</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._local%29%29" class="RktStxLink" data-pltdoc="x">local</a></span>, but with a simpler syntax. Each <span class="RktVar">name</span>
defines a variable (or a function) with the value of the
corresponding <span class="RktVar">expr-for-let</span>.  If <span class="RktVar">expr-for-let</span> is a
<span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span>, <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._letrec%29%29" class="RktStxLink" data-pltdoc="x">letrec</a></span> defines a function, otherwise it
defines a variable.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._let*))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._let%2A%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">let*</a></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expr-for-let</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._letrec%29%29" class="RktStxLink" data-pltdoc="x">letrec</a></span>, but each <span class="RktVar">name</span> can only be used in
<span class="RktVar">expression</span>, and in <span class="RktVar">expr-for-let</span>s occuring after
that <span class="RktVar">name</span>.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._let))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._let%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">let</a></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expr-for-let</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._letrec%29%29" class="RktStxLink" data-pltdoc="x">letrec</a></span>, but the defined <span class="RktVar">name</span>s can be used only
in the last <span class="RktVar">expression</span>, not the <span class="RktVar">expr-for-let</span>s
next to the <span class="RktVar">name</span>s.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._time))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._time%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">time</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Measures the time taken to evaluate <span class="RktVar">expression</span>. After
evaluating <span class="RktVar">expression</span>, <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._time%29%29" class="RktStxLink" data-pltdoc="x">time</a></span> prints out the time
taken by the evaluation (including real time, time taken by the
CPU, and the time spent collecting free memory). The value of
<span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._time%29%29" class="RktStxLink" data-pltdoc="x">time</a></span> is the same as that of <span class="RktVar">expression</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._define))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">define</a></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">variable</span><span class="hspace">&nbsp;</span><span class="RktVar">variable</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Defines a function named <span class="RktVar">name</span>. The <span class="RktVar">expression</span> is the body
of the function. When the function is called,
the values of the arguments are inserted into the body in place of the
<span class="RktVar">variable</span>s. The function returns the value of that new expression.</div></p><p><div class="SIntrapara">The function name&rsquo;s cannot be the same as that of another function or
variable.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktVar">name</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Defines a variable called <span class="RktVar">name</span> with the the value of
<span class="RktVar">expression</span>. The variable name&rsquo;s cannot be the same as that of
another function or variable, and <span class="RktVar">name</span> itself must not appear in
<span class="RktVar">expression</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._define-struct))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-struct%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">define-struct</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">structure-name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">field-name</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Defines a new structure called <span class="RktVar">structure-name</span>. The structure&rsquo;s fields are
named by the <span class="RktVar">field-name</span>s. After the <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-struct%29%29" class="RktStxLink" data-pltdoc="x">define-struct</a></span>, the following new
functions are available:</div></p><ul><li><p><span class="RktSym">make-</span><span class="RktVar">structure-name</span> : takes a number of
arguments equal to the number of fields in the structure,
and creates a new instance of that structure.</p></li><li><p><span class="RktVar">structure-name</span><span class="RktSym">-</span><span class="RktVar">field-name</span> : takes an
instance of the structure and returns the value in the field named by
<span class="RktVar">field-name</span>.</p></li><li><p><span class="RktVar">structure-name</span><span class="RktSym">?</span> : takes any value, and returns
<span class="RktVal">#true</span> if the value is an instance of the structure.</p></li></ul><p>The name of the new functions introduced by <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-struct%29%29" class="RktStxLink" data-pltdoc="x">define-struct</a></span>
must not be the same as that of other functions or variables,
otherwise <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-struct%29%29" class="RktStxLink" data-pltdoc="x">define-struct</a></span> reports an error.</p><p><div class="SIntrapara">In Advanced, <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._define-struct%29%29" class="RktStxLink" data-pltdoc="x">define-struct</a></span> introduces one additional function:
</div><div class="SIntrapara"><ul><li><p><span class="RktSym">set-</span><span class="RktVar">structure-name</span><span class="RktSym">-</span><span class="RktVar">field-name</span><span class="RktSym">!</span>
: takes an instance of the structure and a value, and
mutates the instance&rsquo;s field to the given value.</p></li></ul></div><div class="SIntrapara"></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._cond))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cond%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">cond</a></span></span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktVar">question-expression</span><span class="hspace">&nbsp;</span><span class="RktVar">answer-expression</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cond%29%29" class="RktStxLink" data-pltdoc="x">cond</a></span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktVar">question-expression</span><span class="hspace">&nbsp;</span><span class="RktVar">answer-expression</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta">...</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</a></span><span class="hspace">&nbsp;</span><span class="RktVar">answer-expression</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Chooses a clause based on some condition. <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._cond%29%29" class="RktStxLink" data-pltdoc="x">cond</a></span> finds the first
<span class="RktVar">question-expression</span> that evaluates to <span class="RktVal">#true</span>, then
evaluates the corresponding <span class="RktVar">answer-expression</span>.</div></p><p>If none of the <span class="RktVar">question-expression</span>s evaluates to <span class="RktVal">#true</span>,
<span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cond%29%29" class="RktStxLink" data-pltdoc="x">cond</a></span>&rsquo;s value is the <span class="RktVar">answer-expression</span> of the
<span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</a></span> clause. If there is no <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</a></span>, <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cond%29%29" class="RktStxLink" data-pltdoc="x">cond</a></span> reports
an error. If the result of a <span class="RktVar">question-expression</span> is neither
<span class="RktVal">#true</span> nor <span class="RktVal">#false</span>, <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cond%29%29" class="RktStxLink" data-pltdoc="x">cond</a></span> also reports an error.</p><p><div class="SIntrapara"><a name="(form._((lib._lang/htdp-advanced..rkt)._else))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._else%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">else</a></span></span> cannot be used outside of <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cond%29%29" class="RktStxLink" data-pltdoc="x">cond</a></span>.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><table cellspacing="0" cellpadding="0" class="RktBlk RForeground"><tr><td><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._if))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._if%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">if</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">question-expression</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVar">then-answer-expression</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVar">else-answer-expression</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">When the value of the <span class="RktVar">question-expression</span> is <span class="RktVal">#true</span>,
<span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span> evaluates the <span class="RktVar">then-answer-expression</span>. When the test is
<span class="RktVal">#false</span>, <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span> evaluates the <span class="RktVar">else-answer-expression</span>.</div></p><p><div class="SIntrapara">If the <span class="RktVar">question-expression</span> is neither <span class="RktVal">#true</span> nor
<span class="RktVal">#false</span>, <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span> reports an error.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._and))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._and%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">and</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Evaluates to <span class="RktVal">#true</span> if all the <span class="RktVar">expression</span>s are
<span class="RktVal">#true</span>. If any <span class="RktVar">expression</span> is <span class="RktVal">#false</span>, the <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._and%29%29" class="RktStxLink" data-pltdoc="x">and</a></span>
expression evaluates to <span class="RktVal">#false</span> (and the expressions to the
right of that expression are not evaluated.)</div></p><p><div class="SIntrapara">If any of the expressions evaluate to a value other than <span class="RktVal">#true</span> or
<span class="RktVal">#false</span>, <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._and%29%29" class="RktStxLink" data-pltdoc="x">and</a></span> reports an error.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._or))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._or%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">or</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Evaluates to <span class="RktVal">#true</span> as soon as one of the
<span class="RktVar">expression</span>s is <span class="RktVal">#true</span> (and the expressions to the right of that
expression are not evaluated.) If all of the <span class="RktVar">expression</span>s are <span class="RktVal">#false</span>,
the <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span> expression evaluates to <span class="RktVal">#false</span>.</div></p><p><div class="SIntrapara">If any of the expressions evaluate to a value other than <span class="RktVal">#true</span> or
<span class="RktVal">#false</span>, <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span> reports an error.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._check-expect))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-expect%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">check-expect</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">expected-expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Checks that the first <span class="RktVar">expression</span> evaluates to the same value as the
   <span class="RktVar">expected-expression</span>.</div></p><p><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-expect%29%29" class="RktStxLink" data-pltdoc="x">check-expect</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">fahrenheit-&gt;celsius</span><span class="hspace">&nbsp;</span><span class="RktVal">212</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">100</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-expect%29%29" class="RktStxLink" data-pltdoc="x">check-expect</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">fahrenheit-&gt;celsius</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-4</span>0</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-4</span>0</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">fahrenheit-&gt;celsius</span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._%2A%29%29" class="RktValLink" data-pltdoc="x">*</a></span><span class="hspace">&nbsp;</span><span class="RktVal">5/9</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._-%29%29" class="RktValLink" data-pltdoc="x"><span class="nobreak">-</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktVal">32</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-expect%29%29" class="RktStxLink" data-pltdoc="x">check-expect</a></span> expression must be placed at the top-level of a
 student program. Also it may show up anywhere in the program, including
 ahead of the tested function definition. By placing <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-expect%29%29" class="RktStxLink" data-pltdoc="x">check-expect</a></span>s
 there, a programmer conveys to a future reader the intention behind the
 program with working examples, thus making it often superfluous to read
 the function definition proper.</div></p><p><div class="SIntrapara">It is an error for <span class="RktSym">expr</span> or <span class="RktSym">expected-expr</span> to produce an
inexact number or a function value. As for inexact numbers, it is
<span style="font-style: italic">morally</span> wrong to compare them for plain equality. Instead one
tests whether they are both within a small interval; see
<span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-within%29%29" class="RktStxLink" data-pltdoc="x">check-within</a></span>. As for functions (see Intermediate and up), it is
provably impossible to compare functions.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._check-random))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-random%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">check-random</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">expected-expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Checks that the first <span class="RktVar">expression</span> evaluates to the same value as the
   <span class="RktVar">expected-expression</span>.</div></p><p>The form supplies the same random-number generator to both parts. If both
parts request <span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._random%29%29" class="RktValLink" data-pltdoc="x">random</a></span> numbers from the same interval in the same
order, they receive the same random numbers.</p><p><div class="SIntrapara">Here is a simple example of where <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-random%29%29" class="RktStxLink" data-pltdoc="x">check-random</a></span> is useful:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">WIDTH</span><span class="hspace">&nbsp;</span><span class="RktVal">100</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">HEIGHT</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._%2A%29%29" class="RktValLink" data-pltdoc="x">*</a></span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktSym">WIDTH</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define-struct%29%29" class="RktStxLink" data-pltdoc="x">define-struct</a></span><span class="hspace">&nbsp;</span><span class="RktSym">player</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">A </span><span style="font-style: italic">Player</span><span class="RktCmt"> is </span><span class="RktPn">(</span><span class="RktSym">make-player</span><span class="stt"> </span><span class="RktSym">String</span><span class="stt"> </span><span class="RktSym">Nat</span><span class="stt"> </span><span class="RktSym">Nat</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">String -&gt; Player </span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-random%29%29" class="RktStxLink" data-pltdoc="x">check-random</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">create-randomly-placed-player</span><span class="hspace">&nbsp;</span><span class="RktVal">"David Van Horn"</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-player</span><span class="hspace">&nbsp;</span><span class="RktVal">"David Van Horn"</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._random%29%29" class="RktValLink" data-pltdoc="x">random</a></span><span class="hspace">&nbsp;</span><span class="RktSym">WIDTH</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._random%29%29" class="RktValLink" data-pltdoc="x">random</a></span><span class="hspace">&nbsp;</span><span class="RktSym">HEIGHT</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">create-randomly-placed-player</span><span class="hspace">&nbsp;</span><span class="RktSym">name</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-player</span><span class="hspace">&nbsp;</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._random%29%29" class="RktValLink" data-pltdoc="x">random</a></span><span class="hspace">&nbsp;</span><span class="RktSym">WIDTH</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._random%29%29" class="RktValLink" data-pltdoc="x">random</a></span><span class="hspace">&nbsp;</span><span class="RktSym">HEIGHT</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Note how <span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._random%29%29" class="RktValLink" data-pltdoc="x">random</a></span> is called on the same numbers in the same order in
 both parts of <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-random%29%29" class="RktStxLink" data-pltdoc="x">check-random</a></span>. If the two parts call <span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._random%29%29" class="RktValLink" data-pltdoc="x">random</a></span>
 for different intervals, they are likely to fail:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">String -&gt; Player</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-random%29%29" class="RktStxLink" data-pltdoc="x">check-random</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">create-randomly-placed-player</span><span class="hspace">&nbsp;</span><span class="RktVal">"David Van Horn"</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-player</span><span class="hspace">&nbsp;</span><span class="RktVal">"David Van Horn"</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._random%29%29" class="RktValLink" data-pltdoc="x">random</a></span><span class="hspace">&nbsp;</span><span class="RktSym">WIDTH</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._random%29%29" class="RktValLink" data-pltdoc="x">random</a></span><span class="hspace">&nbsp;</span><span class="RktSym">HEIGHT</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">create-randomly-placed-player</span><span class="hspace">&nbsp;</span><span class="RktSym">name</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">a-helper-function</span><span class="hspace">&nbsp;</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._random%29%29" class="RktValLink" data-pltdoc="x">random</a></span><span class="hspace">&nbsp;</span><span class="RktSym">HEIGHT</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">Striing Number -&gt; Player</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">a-helper-function</span><span class="hspace">&nbsp;</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktSym">height</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-player</span><span class="hspace">&nbsp;</span><span class="RktSym">name</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._random%29%29" class="RktValLink" data-pltdoc="x">random</a></span><span class="hspace">&nbsp;</span><span class="RktSym">WIDTH</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">height</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Because the argument to  <span class="RktSym">a-helper-function</span> is evaluated first,
<span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._random%29%29" class="RktValLink" data-pltdoc="x">random</a></span> is first called for the interval <span style="font-style: italic"></span>[<span style="font-style: italic"></span>0<span style="font-style: italic">,HEIGHT</span>)<span style="font-style: italic"></span> and then
for <span style="font-style: italic"></span>[<span style="font-style: italic"></span>0<span style="font-style: italic">,WIDTH</span>)<span style="font-style: italic"></span>, that is, in a different order than in the preceding
<span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-random%29%29" class="RktStxLink" data-pltdoc="x">check-random</a></span>.</div></p><p><div class="SIntrapara">It is an error for <span class="RktSym">expr</span> or <span class="RktSym">expected-expr</span> to produce a function
value or an inexact number; see note on <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-expect%29%29" class="RktStxLink" data-pltdoc="x">check-expect</a></span> for details.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._check-satisfied))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-satisfied%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">check-satisfied</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">predicate</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Checks that the first <span class="RktVar">expression</span> satisfies the named
   <span class="RktVar">predicate</span> (function of one argument).  Recall that
   &ldquo;satisfies&rdquo; means &ldquo;the function produces <span class="RktVal">#true</span> for the given
   value.&rdquo;</div></p><p><div class="SIntrapara">Here are simple examples for <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-satisfied%29%29" class="RktStxLink" data-pltdoc="x">check-satisfied</a></span>:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-satisfied%29%29" class="RktStxLink" data-pltdoc="x">check-satisfied</a></span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._odd~3f%29%29" class="RktValLink" data-pltdoc="x">odd?</a></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">The only test passed!</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-satisfied%29%29" class="RktStxLink" data-pltdoc="x">check-satisfied</a></span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._even~3f%29%29" class="RktValLink" data-pltdoc="x">even?</a></span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktOut">Ran 1 check.</span></p></td></tr><tr><td><p><span class="RktOut">0 checks passed.</span></p></td></tr><tr><td><p><span class="RktOut">	Actual value 1 does not satisfy "even?".</span></p></td></tr><tr><td><p><span class="RktOut"></span></p></td></tr><tr><td><p><span class="RktOut"></span><span class="hspace">&nbsp;</span><span class="RktOut">At line 3 column 0</span></p></td></tr></table></td></tr></table></blockquote></div></p><p><div class="SIntrapara">In general <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-satisfied%29%29" class="RktStxLink" data-pltdoc="x">check-satisfied</a></span> empowers program designers to use
defined functions to formulate test suites:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">[cons Number [List-of Number]] -&gt; Boolean </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">a function for testing </span><span class="RktSym">htdp-sort</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-expect%29%29" class="RktStxLink" data-pltdoc="x">check-expect</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">sorted?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">#true</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-expect%29%29" class="RktStxLink" data-pltdoc="x">check-expect</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">sorted?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">#false</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">sorted?</span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._cond%29%29" class="RktStxLink" data-pltdoc="x">cond</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._empty~3f%29%29" class="RktValLink" data-pltdoc="x">empty?</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._rest%29%29" class="RktValLink" data-pltdoc="x">rest</a></span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">#true</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._and%29%29" class="RktStxLink" data-pltdoc="x">and</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._~3c~3d%29%29" class="RktValLink" data-pltdoc="x">&lt;=</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._first%29%29" class="RktValLink" data-pltdoc="x">first</a></span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._second%29%29" class="RktValLink" data-pltdoc="x">second</a></span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">sorted?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._rest%29%29" class="RktValLink" data-pltdoc="x">rest</a></span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">[List-of Number] -&gt; [List-of Number]</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">create a sorted version of the given list of numbers </span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-satisfied%29%29" class="RktStxLink" data-pltdoc="x">check-satisfied</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">htdp-sort</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">sorted?</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">htdp-sort</span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._cond%29%29" class="RktStxLink" data-pltdoc="x">cond</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._empty~3f%29%29" class="RktValLink" data-pltdoc="x">empty?</a></span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">insert</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._first%29%29" class="RktValLink" data-pltdoc="x">first</a></span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">htdp-sort</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._rest%29%29" class="RktValLink" data-pltdoc="x">rest</a></span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">Number [List-of Number] -&gt; [List-of Number]</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">insert </span><span class="RktSym">x</span><span class="RktCmt"> into </span><span class="RktSym">l</span><span class="RktCmt"> at proper place </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span style="font-weight: bold">assume</span><span class="RktCmt"> </span><span class="RktSym">l</span><span class="RktCmt"> is arranged in ascending order </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">the result is sorted in the same way </span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">insert</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._cond%29%29" class="RktStxLink" data-pltdoc="x">cond</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._empty~3f%29%29" class="RktValLink" data-pltdoc="x">empty?</a></span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._~3c~3d%29%29" class="RktValLink" data-pltdoc="x">&lt;=</a></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._first%29%29" class="RktValLink" data-pltdoc="x">first</a></span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._cons%29%29" class="RktValLink" data-pltdoc="x">cons</a></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._cons%29%29" class="RktValLink" data-pltdoc="x">cons</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._first%29%29" class="RktValLink" data-pltdoc="x">first</a></span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">insert</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._rest%29%29" class="RktValLink" data-pltdoc="x">rest</a></span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div></p><p><div class="SIntrapara">And yes, the results of <span class="RktSym">htdp-sort</span> satisfy the <span class="RktSym">sorted?</span> predicate:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-satisfied%29%29" class="RktStxLink" data-pltdoc="x">check-satisfied</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">htdp-sort</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">sorted?</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._check-within))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-within%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">check-within</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">expected-expression</span><span class="hspace">&nbsp;</span><span class="RktVar">delta</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Checks whether the value of the <span class="RktVar">expression</span> expression is
  structurally equal to the value produced by the
  <span class="RktVar">expected-expression</span> expression; every number in the first
  expression must be within <span class="RktVar">delta</span> of the corresponding number in
  the second expression.</div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define-struct%29%29" class="RktStxLink" data-pltdoc="x">define-struct</a></span><span class="hspace">&nbsp;</span><span class="RktSym">roots</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._sqrt%29%29" class="RktValLink" data-pltdoc="x">sqrt</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">RT is [List-of (make-roots Number Number)]</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">roots-table</span><span class="hspace">&nbsp;</span><span class="RktSym">xs</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._map%29%29" class="RktValLink" data-pltdoc="x">map</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">a</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-roots</span><span class="hspace">&nbsp;</span><span class="RktSym">a</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._sqrt%29%29" class="RktValLink" data-pltdoc="x">sqrt</a></span><span class="hspace">&nbsp;</span><span class="RktSym">a</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">xs</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p><div class="SIntrapara">Due to the presence of inexact numbers in nested data, <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-within%29%29" class="RktStxLink" data-pltdoc="x">check-within</a></span> is the
correct choice for testing, and the test succeeds if <span class="RktVar">delta</span> is reasonably
large:
</div><div class="SIntrapara"><p><div class="SIntrapara">Example:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-within%29%29" class="RktStxLink" data-pltdoc="x">check-within</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">roots-table</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace">&nbsp;</span><span class="RktVal">1.0</span><span class="hspace">&nbsp;</span><span class="RktVal">2.0</span><span class="hspace">&nbsp;</span><span class="RktVal">3.0</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-roots</span><span class="hspace">&nbsp;</span><span class="RktVal">1.0</span><span class="hspace">&nbsp;</span><span class="RktVal">1.0</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-roots</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">1.414</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-roots</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">1.713</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">0.1</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktOut">The only test passed!</span></p></td></tr></table></blockquote></div></p></div><div class="SIntrapara">In contrast, when <span class="RktVar">delta</span> is small, the test fails:
</div><div class="SIntrapara"><p><div class="SIntrapara">Example:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-within%29%29" class="RktStxLink" data-pltdoc="x">check-within</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">roots-table</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace">&nbsp;</span><span class="RktVal">2.0</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-roots</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">1.414</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">1e-05</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktOut">Ran 1 check.</span></p></td></tr><tr><td><p><span class="RktOut">0 checks passed.</span></p></td></tr><tr><td><p><span class="RktOut">	Actual value '((make-roots 2.0 1.4142135623730951)) is not within 1e-05 of expected value '((make-roots 2 1.414)).</span></p></td></tr><tr><td><p><span class="RktOut"></span><span class="hspace">&nbsp;</span><span class="RktOut">At line 5 column 0</span></p></td></tr></table></td></tr></table></blockquote></div></p></div></p><p>It is an error for <span class="RktSym">expressions</span> or <span class="RktVar">expected-expression</span>
  to produce a function value; see note on <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-expect%29%29" class="RktStxLink" data-pltdoc="x">check-expect</a></span> for details.</p><p><div class="SIntrapara">If <span class="RktVar">delta</span> is not a number, <span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-within%29%29" class="RktStxLink" data-pltdoc="x">check-within</a></span> reports an error.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._check-error))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-error%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">check-error</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">expected-error-message</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-error%29%29" class="RktStxLink" data-pltdoc="x">check-error</a></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Checks that the <span class="RktVar">expression</span> reports an error, where the error messages
   matches the value of <span class="RktVar">expected-error-message</span>, if it is present.</div></p><p><div class="SIntrapara">Here is a typical beginner example that calls for a use of <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-error%29%29" class="RktStxLink" data-pltdoc="x">check-error</a></span>:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">sample-table</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">"matthias"</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">(</span><span class="RktVal">"matthew"</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">20</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">(</span><span class="RktVal">"robby"</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal"><span class="nobreak">-1</span></span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">(</span><span class="RktVal">"shriram"</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">18</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">[List-of [list String Number]] String -&gt; Number </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">determine the number associated with </span><span class="RktSym">s</span><span class="RktCmt"> in </span><span class="RktSym">table</span><span class="RktCmt"> </span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">lookup</span><span class="hspace">&nbsp;</span><span class="RktSym">table</span><span class="hspace">&nbsp;</span><span class="RktSym">s</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._cond%29%29" class="RktStxLink" data-pltdoc="x">cond</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._empty~3f%29%29" class="RktValLink" data-pltdoc="x">empty?</a></span><span class="hspace">&nbsp;</span><span class="RktSym">table</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._error%29%29" class="RktValLink" data-pltdoc="x">error</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._string-append%29%29" class="RktValLink" data-pltdoc="x">string-append</a></span><span class="hspace">&nbsp;</span><span class="RktSym">s</span><span class="hspace">&nbsp;</span><span class="RktVal">" not found"</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._else%29%29" class="RktStxLink" data-pltdoc="x">else</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._string~3d~3f%29%29" class="RktValLink" data-pltdoc="x">string=?</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._first%29%29" class="RktValLink" data-pltdoc="x">first</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._first%29%29" class="RktValLink" data-pltdoc="x">first</a></span><span class="hspace">&nbsp;</span><span class="RktSym">table</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">s</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._second%29%29" class="RktValLink" data-pltdoc="x">second</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._first%29%29" class="RktValLink" data-pltdoc="x">first</a></span><span class="hspace">&nbsp;</span><span class="RktSym">table</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">lookup</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._rest%29%29" class="RktValLink" data-pltdoc="x">rest</a></span><span class="hspace">&nbsp;</span><span class="RktSym">table</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div></p><p>Consider the following two examples in this context:</p><p><div class="SIntrapara">Example:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-expect%29%29" class="RktStxLink" data-pltdoc="x">check-expect</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">lookup</span><span class="hspace">&nbsp;</span><span class="RktSym">sample-table</span><span class="hspace">&nbsp;</span><span class="RktVal">"matthew"</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">20</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">The only test passed!</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><p><div class="SIntrapara">Example:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-error%29%29" class="RktStxLink" data-pltdoc="x">check-error</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">lookup</span><span class="hspace">&nbsp;</span><span class="RktSym">sample-table</span><span class="hspace">&nbsp;</span><span class="RktVal">"kathi"</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">"kathi not found"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">The only test passed!</span></p></td></tr></table></blockquote></div></p></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._check-member-of))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-member-of%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">check-member-of</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Checks that the value of the first <span class="RktVar">expression</span> is that of
   one of the following <span class="RktVar">expression</span>s.</div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">[List-of X] -&gt; X </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">pick a random element from the given list </span><span class="RktSym">l</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">pick-one</span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._list-ref%29%29" class="RktValLink" data-pltdoc="x">list-ref</a></span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._random%29%29" class="RktValLink" data-pltdoc="x">random</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._length%29%29" class="RktValLink" data-pltdoc="x">length</a></span><span class="hspace">&nbsp;</span><span class="RktSym">l</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p><div class="SIntrapara">Example:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-member-of%29%29" class="RktStxLink" data-pltdoc="x">check-member-of</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">pick-one</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">"a"</span><span class="hspace">&nbsp;</span><span class="RktVal">"b"</span><span class="hspace">&nbsp;</span><span class="RktVal">"c"</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">"a"</span><span class="hspace">&nbsp;</span><span class="RktVal">"b"</span><span class="hspace">&nbsp;</span><span class="RktVal">"c"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">The only test passed!</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara">It is an error for any of <span class="RktSym">expressions</span> to produce a function value; see
  note on <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-expect%29%29" class="RktStxLink" data-pltdoc="x">check-expect</a></span> for details.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._check-range))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._check-range%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">check-range</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">expression</span><span class="hspace">&nbsp;</span><span class="RktVar">low-expression</span><span class="hspace">&nbsp;</span><span class="RktVar">high-expression</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Checks that the value of the first <span class="RktVar">expression</span> is a number in
   between the value of the <span class="RktVar">low-expression</span> and the
   <span class="RktVar">high-expression</span>, inclusive.</div></p><p><div class="SIntrapara">A <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-range%29%29" class="RktStxLink" data-pltdoc="x">check-range</a></span> form is best used to delimit the possible results of
functions that compute inexact numbers:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">EPSILON</span><span class="hspace">&nbsp;</span><span class="RktVal">0.001</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">[Real -&gt; Real] Real -&gt; Real </span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">what is the slope of </span><span class="RktSym">f</span><span class="RktCmt"> at </span><span class="RktSym">x</span><span class="RktCmt">?</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">differentiate</span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">slope</span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._-%29%29" class="RktValLink" data-pltdoc="x"><span class="nobreak">-</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">EPSILON</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._%2B%29%29" class="RktValLink" data-pltdoc="x">+</a></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">EPSILON</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">[Real -&gt; Real] Real Real -&gt; Real </span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">slope-of</span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktSym">left</span><span class="hspace">&nbsp;</span><span class="RktSym">right</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._%2F%29%29" class="RktValLink" data-pltdoc="x">/</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._-%29%29" class="RktValLink" data-pltdoc="x"><span class="nobreak">-</span></a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktSym">right</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktSym">left</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktSym">EPSILON</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-range%29%29" class="RktStxLink" data-pltdoc="x">check-range</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">differentiate</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="intermediate.html#%28def._htdp-intermediate._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._sin%29%29" class="RktValLink" data-pltdoc="x">sin</a></span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">0.99</span><span class="hspace">&nbsp;</span><span class="RktVal">1.0</span><span class="RktPn">)</span></td></tr></table></blockquote></div></p><p><div class="SIntrapara">It is an error for <span class="RktVar">expression</span>, <span class="RktVar">low-expression</span>, or
<span class="RktVar">high-expression</span> to produce a function value;
see note on <span class="RktSym"><a href="intermediate.html#%28form._%28%28lib._lang%2Fhtdp-intermediate..rkt%29._check-expect%29%29" class="RktStxLink" data-pltdoc="x">check-expect</a></span> for details.  </div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._lang/htdp-advanced..rkt)._require))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._require%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">require</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">string</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Makes the definitions of the module specified by <span class="RktVar">string</span>
available in the current module (i.e., the current file), where
<span class="RktVar">string</span> refers to a file relative to the current file.</div></p><p><div class="SIntrapara">The <span class="RktVar">string</span> is constrained in several ways to avoid
problems with different path conventions on different platforms: a
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">/</span><span class="hspace"></span></span> is a directory separator, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">.</span><span class="hspace"></span></span> always means the
current directory, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">..</span><span class="hspace"></span></span> always means the parent directory,
path elements can use only <span class="RktInBG"><span class="hspace"></span><span class="RktIn">a</span><span class="hspace"></span></span> through <span class="RktInBG"><span class="hspace"></span><span class="RktIn">z</span><span class="hspace"></span></span>
(uppercase or lowercase), <span class="RktInBG"><span class="hspace"></span><span class="RktIn">0</span><span class="hspace"></span></span> through <span class="RktInBG"><span class="hspace"></span><span class="RktIn">9</span><span class="hspace"></span></span>,
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">_</span><span class="hspace"></span></span>, and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">.</span><span class="hspace"></span></span>, and the string cannot be
empty or contain a leading or trailing <span class="RktInBG"><span class="hspace"></span><span class="RktIn">/</span><span class="hspace"></span></span>.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="hspace">&nbsp;</span><span class="RktVar">module-name</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Accesses a file in an installed library. The library name is an
identifier with the same constraints as for a relative-path string
(though without the quotes), with the additional constraint that it
must not contain a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">.</span><span class="hspace"></span></span>.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">lib</span><span class="hspace">&nbsp;</span><span class="RktVar">string</span><span class="hspace">&nbsp;</span><span class="RktVar">string</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Accesses a file in an installed library, making its definitions
available in the current module (i.e., the current file). The first
<span class="RktVar">string</span> names the library file, and the remaining
<span class="RktVar">string</span>s name the collection (and sub-collection, and so on)
where the file is installed. Each string is constrained in the same
way as for the <span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="stt"> </span><span class="RktVar">string</span><span class="RktPn">)</span> form.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">planet</span><span class="hspace">&nbsp;</span><span class="RktVar">string</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktVar">string</span><span class="hspace">&nbsp;</span><span class="RktVar">string</span><span class="hspace">&nbsp;</span><span class="RktVar">number</span><span class="hspace">&nbsp;</span><span class="RktVar">number</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">planet</span><span class="hspace">&nbsp;</span><span class="RktVar">id</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._lang%2Fhtdp-advanced..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">planet</span><span class="hspace">&nbsp;</span><span class="RktVar">string</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Accesses a library that is distributed on the internet via the
<span class="planetName">PLaneT</span> server, making it definitions available in the current module
(i.e., current file).</div></p><p>The full grammar for planet requires is given in
<a href="https://download.racket-lang.org/releases/7.7/doc/local-redirect/index.html?doc=reference&amp;rel=require.html&amp;version=7.7" class="Sq" data-pltdoc="x">Importing and Exporting: <span class="RktSym"><span class="RktStxLink">require</span></span> and <span class="RktSym"><span class="RktStxLink">provide</span></span></a>, but
the best place to find examples of the syntax is on the
<a href="http://planet.racket-lang.org">the <span class="planetName">PLaneT</span> server</a>, in the
description of a specific package.</p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-tag="&quot;advanced-pre-defined&quot;">5.5<tt>&nbsp;</tt><a name="(part._advanced-pre-defined)"></a>Pre-Defined Functions</h4><p>The remaining subsections list those functions that are built into the
programming language. All other functions are imported from a teachpack or
must be defined in the program. </p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Numbers__Integers__Rationals__Reals__Complex__Exacts__Inexacts&quot;">5.6<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Numbers__.Integers__.Rationals__.Reals__.Complex__.Exacts__.Inexacts)"></a>Numbers: Integers, Rationals, Reals, Complex, Exacts, Inexacts</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._-))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._-%29%29" class="RktValDef RktValLink" data-pltdoc="x"><span class="nobreak">-</span></a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara"><a name="(idx._htdp-advanced._(gentag._53._(lib._scribblings/htdp-langs/htdp-langs..scrbl)._htdp-advanced))"></a>Subtracts the second (and following) number(s) from the first ;
negates the number if there is only one argument.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-</span></span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">-5</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-</span></span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">2</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-</span></span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">1</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._~3c))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~3c%29%29" class="RktValDef RktValLink" data-pltdoc="x">&lt;</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span><span class="RktVar">z</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">z</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Compares (real) numbers for less-than.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">&lt;</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="hspace">&nbsp;</span><span class="RktVal">2/5</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._~3c~3d))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~3c~3d%29%29" class="RktValDef RktValLink" data-pltdoc="x">&lt;=</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span><span class="RktVar">z</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">z</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Compares (real) numbers for less-than or equality.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">&lt;=</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="hspace">&nbsp;</span><span class="RktVal">2/5</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._~3d))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~3d%29%29" class="RktValDef RktValLink" data-pltdoc="x">=</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span><span class="RktVar">z</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">z</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Compares numbers for equality.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">=</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="hspace">&nbsp;</span><span class="RktVal">2/5</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._~3e))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~3e%29%29" class="RktValDef RktValLink" data-pltdoc="x">&gt;</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span><span class="RktVar">z</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">z</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Compares (real) numbers for greater-than.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">&gt;</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="hspace">&nbsp;</span><span class="RktVal">2/5</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._~3e~3d))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~3e~3d%29%29" class="RktValDef RktValLink" data-pltdoc="x">&gt;=</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span><span class="RktVar">z</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">z</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Compares (real) numbers for greater-than or equality.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">&gt;=</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._abs))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._abs%29%29" class="RktValDef RktValLink" data-pltdoc="x">abs</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">real</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the absolute value of a real number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">abs</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-1</span>2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">12</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._acos))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._acos%29%29" class="RktValDef RktValLink" data-pltdoc="x">acos</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the arccosine (inverse of cos) of a number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">acos</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i1.5707963267948966</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._add1))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._add1%29%29" class="RktValDef RktValLink" data-pltdoc="x">add1</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Increments the given number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">add1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">3</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._angle))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._angle%29%29" class="RktValDef RktValLink" data-pltdoc="x">angle</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">real</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the angle from a complex number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">angle</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-polar</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i-2.2831853071795867</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._asin))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._asin%29%29" class="RktValDef RktValLink" data-pltdoc="x">asin</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the arcsine (inverse of sin) of a number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">asin</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">0</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._atan))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._atan%29%29" class="RktValDef RktValLink" data-pltdoc="x">atan</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the arctangent of the given number:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">atan</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">0</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">atan</span><span class="hspace">&nbsp;</span><span class="RktVal">0.5</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i0.4636476090008061</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara">Also comes in a two-argument version where <span class="RktPn">(</span><span class="RktSym">atan</span><span class="stt"> </span><span class="RktVar">x</span><span class="stt"> </span><span class="RktSym">y</span><span class="RktPn">)</span> computes
<span class="RktPn">(</span><span class="RktSym">atan</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">/</span><span class="stt"> </span><span class="RktVar">x</span><span class="stt"> </span><span class="RktSym">y</span><span class="RktPn">)</span><span class="RktPn">)</span> but the signs of <span class="RktVar">x</span> and <span class="RktSym">y</span>
determine the quadrant of the result and the result tends to be more
accurate than that of the 1-argument version in borderline cases:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">atan</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i0.6435011087932844</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">atan</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-2</span></span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-1</span></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i-2.0344439357957027</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._ceiling))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._ceiling%29%29" class="RktValDef RktValLink" data-pltdoc="x">ceiling</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the closest integer (exact or inexact) above a real
number. See <span class="RktSym">round</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">ceiling</span><span class="hspace">&nbsp;</span><span class="RktVal">12.3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i13.0</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._complex~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._complex~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">complex?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is complex.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">complex?</span><span class="hspace">&nbsp;</span><span class="RktVal">1-2i</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._conjugate))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._conjugate%29%29" class="RktValDef RktValLink" data-pltdoc="x">conjugate</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Flips the sign of the imaginary part of a complex number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">conjugate</span><span class="hspace">&nbsp;</span><span class="RktVal">3+4i</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">3-4i</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">conjugate</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-2</span>-5i</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">-2+5i</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">conjugate</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-polar</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i-1.960930862590836+2.2704074859237844i</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cos))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cos%29%29" class="RktValDef RktValLink" data-pltdoc="x">cos</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the <a name="(idx._htdp-advanced._(gentag._54._(lib._scribblings/htdp-langs/htdp-langs..scrbl)._htdp-advanced))"></a>cosine of a number (radians).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cos</span><span class="hspace">&nbsp;</span><span class="RktSym">pi</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i-1.0</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cosh))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cosh%29%29" class="RktValDef RktValLink" data-pltdoc="x">cosh</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the hyperbolic cosine of a number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cosh</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i11013.232920103324</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._current-seconds))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._current-seconds%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-seconds</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Determines the current time in seconds elapsed (since a platform-specific starting date).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">current-seconds</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">1588368937</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._denominator))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._denominator%29%29" class="RktValDef RktValLink" data-pltdoc="x">denominator</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">rational?</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the denominator of a rational.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">denominator</span><span class="hspace">&nbsp;</span><span class="RktVal">2/3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">3</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._e))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._e%29%29" class="RktValDef RktValLink" data-pltdoc="x">e</a></span></span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Euler&rsquo;s number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">e</span></td></tr><tr><td><p><span class="RktRes">#i2.718281828459045</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._even~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._even~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">even?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if some integer (exact or inexact) is even or not.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">even?</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._exact-~3einexact))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._exact-~3einexact%29%29" class="RktValDef RktValLink" data-pltdoc="x">exact-&gt;inexact</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Converts an exact number to an inexact one.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">exact-&gt;inexact</span><span class="hspace">&nbsp;</span><span class="RktVal">12</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i12.0</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._exact~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._exact~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">exact?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some number is exact.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">exact?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">sqrt</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._exp))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._exp%29%29" class="RktValDef RktValLink" data-pltdoc="x">exp</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines e raised to a number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">exp</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-2</span></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i0.1353352832366127</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._expt))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._expt%29%29" class="RktValDef RktValLink" data-pltdoc="x">expt</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the power of the first to the second number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">expt</span><span class="hspace">&nbsp;</span><span class="RktVal">16</span><span class="hspace">&nbsp;</span><span class="RktVal">1/2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">4</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">expt</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-4</span></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">1/81</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._floor))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._floor%29%29" class="RktValDef RktValLink" data-pltdoc="x">floor</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the closest integer (exact or inexact) below a real
number. See <span class="RktSym">round</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">floor</span><span class="hspace">&nbsp;</span><span class="RktVal">12.3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i12.0</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._gcd))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._gcd%29%29" class="RktValDef RktValLink" data-pltdoc="x">gcd</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the greatest common divisor of two integers (exact or inexact).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">gcd</span><span class="hspace">&nbsp;</span><span class="RktVal">6</span><span class="hspace">&nbsp;</span><span class="RktVal">12</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">2</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._imag-part))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._imag-part%29%29" class="RktValDef RktValLink" data-pltdoc="x">imag-part</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">real</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the imaginary part from a complex number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">imag-part</span><span class="hspace">&nbsp;</span><span class="RktVal">3+4i</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">4</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._inexact-~3eexact))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._inexact-~3eexact%29%29" class="RktValDef RktValLink" data-pltdoc="x">inexact-&gt;exact</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Approximates an inexact number by an exact one.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">inexact-&gt;exact</span><span class="hspace">&nbsp;</span><span class="RktVal">12.0</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">12</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._inexact~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._inexact~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">inexact?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some number is inexact.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">inexact?</span><span class="hspace">&nbsp;</span><span class="RktVal">1-2i</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._integer-~3echar))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._integer-~3echar%29%29" class="RktValDef RktValLink" data-pltdoc="x">integer-&gt;char</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">char</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">exact-integer?</span></td></tr></table></blockquote></div><div class="SIntrapara">Looks up the character that corresponds to the given exact integer in the ASCII table (if any).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">integer-&gt;char</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#\*</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._integer-sqrt))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._integer-sqrt%29%29" class="RktValDef RktValLink" data-pltdoc="x">integer-sqrt</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">complex</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the integer or imaginary-integer square root of an integer.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">integer-sqrt</span><span class="hspace">&nbsp;</span><span class="RktVal">11</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">3</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">integer-sqrt</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-1</span>1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">0+3i</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._integer~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._integer~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">integer?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is an integer (exact or inexact).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">integer?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">sqrt</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._lcm))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._lcm%29%29" class="RktValDef RktValLink" data-pltdoc="x">lcm</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the least common multiple of two integers (exact or inexact).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">lcm</span><span class="hspace">&nbsp;</span><span class="RktVal">6</span><span class="hspace">&nbsp;</span><span class="RktVal">12</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">24</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._log))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._log%29%29" class="RktValDef RktValLink" data-pltdoc="x">log</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the base-e logarithm of a number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">log</span><span class="hspace">&nbsp;</span><span class="RktVal">12</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i2.4849066497880004</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._magnitude))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._magnitude%29%29" class="RktValDef RktValLink" data-pltdoc="x">magnitude</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">real</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the magnitude of a complex number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">magnitude</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-polar</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i3.0</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._make-polar))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-polar%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-polar</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a complex from a magnitude and angle.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-polar</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i-1.960930862590836-2.2704074859237844i</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._make-rectangular))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-rectangular%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-rectangular</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a complex from a real and an imaginary part.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-rectangular</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">3+4i</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._max))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._max%29%29" class="RktValDef RktValLink" data-pltdoc="x">max</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">real</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the largest number&#8212;<wbr></wbr>aka, the <a name="(idx._htdp-advanced._(gentag._55._(lib._scribblings/htdp-langs/htdp-langs..scrbl)._htdp-advanced))"></a>maximum.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">max</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="hspace">&nbsp;</span><span class="RktVal">7</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">9</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._min))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._min%29%29" class="RktValDef RktValLink" data-pltdoc="x">min</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">real</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the smallest number&#8212;<wbr></wbr>aka, the <a name="(idx._htdp-advanced._(gentag._56._(lib._scribblings/htdp-langs/htdp-langs..scrbl)._htdp-advanced))"></a>minimum.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">min</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="hspace">&nbsp;</span><span class="RktVal">7</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">0</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._modulo))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._modulo%29%29" class="RktValDef RktValLink" data-pltdoc="x">modulo</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr></table></blockquote></div><div class="SIntrapara">Finds the remainder of the division of the first number by the second:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">modulo</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">1</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">modulo</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-4</span></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">-1</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._negative~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._negative~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">negative?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if some real number is strictly smaller than zero.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">negative?</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-2</span></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._number-~3estring))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._number-~3estring%29%29" class="RktValDef RktValLink" data-pltdoc="x">number-&gt;string</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Converts a number to a string.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">number-&gt;string</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"42"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._number~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._number~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">number?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">n</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">n</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is a number:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">number?</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello world"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">number?</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._numerator))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._numerator%29%29" class="RktValDef RktValLink" data-pltdoc="x">numerator</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">rational?</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the numerator of a rational.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">numerator</span><span class="hspace">&nbsp;</span><span class="RktVal">2/3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">2</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._odd~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._odd~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">odd?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if some integer (exact or inexact) is odd or not.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">odd?</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._pi))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._pi%29%29" class="RktValDef RktValLink" data-pltdoc="x">pi</a></span></span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">The ratio of a circle&rsquo;s circumference to its diameter.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">pi</span></td></tr><tr><td><p><span class="RktRes">#i3.141592653589793</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._positive~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._positive~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">positive?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if some real number is strictly larger than zero.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">positive?</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-2</span></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._quotient))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._quotient%29%29" class="RktValDef RktValLink" data-pltdoc="x">quotient</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr></table></blockquote></div><div class="SIntrapara">Divides the first integer&#8212;<wbr></wbr>also called dividend&#8212;<wbr></wbr>by the second&#8212;<wbr></wbr>known as
divisor&#8212;<wbr></wbr>to obtain the <a name="(idx._htdp-advanced._(gentag._57._(lib._scribblings/htdp-langs/htdp-langs..scrbl)._htdp-advanced))"></a>quotient.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">quotient</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">4</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">quotient</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">0</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._random))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._random%29%29" class="RktValDef RktValLink" data-pltdoc="x">random</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">natural</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">natural</span></td></tr></table></blockquote></div><div class="SIntrapara">Generates a random number. If given one argument <span class="RktSym">random</span> returns a natural number
less than the given natural. In ASL, if given no arguments, <span class="RktSym">random</span> generates a
random inexact number between 0.0 and 1.0 exclusive.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">random</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i0.13637903806912713</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">random</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i0.13144759399376335</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">random</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">13</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">random</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">40</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._rational~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._rational~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">rational?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is a rational number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">rational?</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">rational?</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-2</span>.349</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">rational?</span><span class="hspace">&nbsp;</span><span class="RktVal">#i1.23456789</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">rational?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">sqrt</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-1</span></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">rational?</span><span class="hspace">&nbsp;</span><span class="RktSym">pi</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">rational?</span><span class="hspace">&nbsp;</span><span class="RktSym">e</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">rational?</span><span class="hspace">&nbsp;</span><span class="RktVal">1-2i</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara">As the interactions show, the teaching languages considers many more
numbers as rationals than expected. In particular, <span class="RktSym">pi</span> is a
rational number because it is only a finite approximation to the
mathematical &#960;. Think of <span class="RktSym">rational?</span> as a suggestion to think of
these numbers as fractions.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._real-part))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._real-part%29%29" class="RktValDef RktValLink" data-pltdoc="x">real-part</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">real</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the real part from a complex number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">real-part</span><span class="hspace">&nbsp;</span><span class="RktVal">3+4i</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">3</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._real~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._real~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">real?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is a real number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">real?</span><span class="hspace">&nbsp;</span><span class="RktVal">1-2i</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._remainder))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._remainder%29%29" class="RktValDef RktValLink" data-pltdoc="x">remainder</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the <a name="(idx._htdp-advanced._(gentag._58._(lib._scribblings/htdp-langs/htdp-langs..scrbl)._htdp-advanced))"></a>remainder of dividing
the first by the second integer (exact or inexact).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">remainder</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">1</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">remainder</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">3</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._round))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._round%29%29" class="RktValDef RktValLink" data-pltdoc="x">round</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Rounds a real number to an integer (rounds to even to break ties). See
<span class="RktSym">floor</span> and <span class="RktSym">ceiling</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">round</span><span class="hspace">&nbsp;</span><span class="RktVal">12.3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i12.0</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._sgn))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sgn%29%29" class="RktValDef RktValLink" data-pltdoc="x">sgn</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">union</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">#i1.0</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">#i0.0</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-1</span></span><span class="hspace">&nbsp;</span><span class="RktVal">#i-1.0</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">real</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the sign of a real number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">sgn</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-1</span>2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">-1</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._sin))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sin%29%29" class="RktValDef RktValLink" data-pltdoc="x">sin</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the <a name="(idx._htdp-advanced._(gentag._59._(lib._scribblings/htdp-langs/htdp-langs..scrbl)._htdp-advanced))"></a>sine of a number (radians).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">sin</span><span class="hspace">&nbsp;</span><span class="RktSym">pi</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i1.2246467991473532e-16</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._sinh))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sinh%29%29" class="RktValDef RktValLink" data-pltdoc="x">sinh</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the hyperbolic sine of a number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">sinh</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i11013.232874703393</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._sqr))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sqr%29%29" class="RktValDef RktValLink" data-pltdoc="x">sqr</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the <a name="(idx._htdp-advanced._(gentag._60._(lib._scribblings/htdp-langs/htdp-langs..scrbl)._htdp-advanced))"></a>square of a number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">sqr</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">64</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._sqrt))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sqrt%29%29" class="RktValDef RktValLink" data-pltdoc="x">sqrt</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the square root of a number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">sqrt</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">3</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">sqrt</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i1.4142135623730951</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._sub1))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sub1%29%29" class="RktValDef RktValLink" data-pltdoc="x">sub1</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Decrements the given number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">sub1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">1</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._tan))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._tan%29%29" class="RktValDef RktValLink" data-pltdoc="x">tan</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Computes the <a name="(idx._htdp-advanced._(gentag._61._(lib._scribblings/htdp-langs/htdp-langs..scrbl)._htdp-advanced))"></a>tangent of a number (radians).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">tan</span><span class="hspace">&nbsp;</span><span class="RktSym">pi</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i-1.2246467991473532e-16</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._zero~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._zero~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">zero?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if some number is zero or not.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">zero?</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Booleans&quot;">5.7<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Booleans)"></a>Booleans</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._boolean-~3estring))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._boolean-~3estring%29%29" class="RktValDef RktValLink" data-pltdoc="x">boolean-&gt;string</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a string for the given boolean
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">boolean-&gt;string</span><span class="hspace">&nbsp;</span><span class="RktVal">#false</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"#false"</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">boolean-&gt;string</span><span class="hspace">&nbsp;</span><span class="RktVal">#true</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"#true"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._boolean~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._boolean~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">boolean=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether two booleans are equal.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">boolean=?</span><span class="hspace">&nbsp;</span><span class="RktVal">#true</span><span class="hspace">&nbsp;</span><span class="RktVal">#false</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._boolean~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._boolean~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">boolean?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is a boolean.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">boolean?</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">boolean?</span><span class="hspace">&nbsp;</span><span class="RktVal">#false</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._false~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._false~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">false?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether a value is false.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">false?</span><span class="hspace">&nbsp;</span><span class="RktVal">#false</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._not))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._not%29%29" class="RktValDef RktValLink" data-pltdoc="x">not</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></td></tr></table></blockquote></div><div class="SIntrapara">Negates a boolean value.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">not</span><span class="hspace">&nbsp;</span><span class="RktVal">#false</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Symbols&quot;">5.8<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Symbols)"></a>Symbols</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._symbol-~3estring))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._symbol-~3estring%29%29" class="RktValDef RktValLink" data-pltdoc="x">symbol-&gt;string</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">symbol</span></td></tr></table></blockquote></div><div class="SIntrapara">Converts a symbol to a string.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">symbol-&gt;string</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">c</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"c"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._symbol~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._symbol~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">symbol=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">symbol</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">symbol</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether two symbols are equal.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">symbol=?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">a</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">b</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._symbol~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._symbol~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">symbol?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is a symbol.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">symbol?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">a</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Lists&quot;">5.9<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Lists)"></a>Lists</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._append))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._append%29%29" class="RktValDef RktValLink" data-pltdoc="x">append</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">any</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">any</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a single list from several.
In ASL, <span class="RktSym">list*</span> also deals with cyclic lists.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._assoc))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._assoc%29%29" class="RktValDef RktValLink" data-pltdoc="x">assoc</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">union</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">any</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">#false</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">any</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces the first pair on <span class="RktVar">l</span> whose <span class="RktSym">first</span> is <span class="RktSym">equal?</span> to <span class="RktVar">x</span>;
otherwise it produces <span class="RktVal">#false</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">assoc</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">"world"</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">"good"</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list "hello" 3)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._assq))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._assq%29%29" class="RktValDef RktValLink" data-pltdoc="x">assq</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">union</span><span class="hspace">&nbsp;</span><span class="RktVal">#false</span><span class="hspace">&nbsp;</span><span class="RktSym">cons?</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some item is the first item of a pair in a list of
pairs. (It compares the items with <span class="RktSym">eq?</span>.)
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">a</span></td></tr><tr><td><p><span class="RktRes">(list (list 'a 22) (list 'b 8) (list 'c 70))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">assq</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">b</span><span class="hspace">&nbsp;</span><span class="RktSym">a</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 'b 8)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._caaar))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._caaar%29%29" class="RktValDef RktValLink" data-pltdoc="x">caaar</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">LISP-style selector: <span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">w</span></td></tr><tr><td><p><span class="RktRes">(list (list (list (list "bye") 3) #true) 42)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">caaar</span><span class="hspace">&nbsp;</span><span class="RktSym">w</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list "bye")</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._caadr))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._caadr%29%29" class="RktValDef RktValLink" data-pltdoc="x">caadr</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">LISP-style selector: <span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">caadr</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">a</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">d</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'a</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._caar))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._caar%29%29" class="RktValDef RktValLink" data-pltdoc="x">caar</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">LISP-style selector: <span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">y</span></td></tr><tr><td><p><span class="RktRes">(list (list (list 1 2 3) #false "world"))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">caar</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 1 2 3)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cadar))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cadar%29%29" class="RktValDef RktValLink" data-pltdoc="x">cadar</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">LISP-style selector: <span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">w</span></td></tr><tr><td><p><span class="RktRes">(list (list (list (list "bye") 3) #true) 42)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cadar</span><span class="hspace">&nbsp;</span><span class="RktSym">w</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cadddr))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cadddr%29%29" class="RktValDef RktValLink" data-pltdoc="x">cadddr</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">LISP-style selector: <span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">v</span></td></tr><tr><td><p><span class="RktRes">(list 1 2 3 4 5 6 7 8 9 'A)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cadddr</span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">4</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._caddr))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._caddr%29%29" class="RktValDef RktValLink" data-pltdoc="x">caddr</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">LISP-style selector: <span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">caddr</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cadr))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cadr%29%29" class="RktValDef RktValLink" data-pltdoc="x">cadr</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">LISP-style selector: <span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cadr</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"hello"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._car))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._car%29%29" class="RktValDef RktValLink" data-pltdoc="x">car</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">cons?</span></td></tr></table></blockquote></div><div class="SIntrapara">Selects the first item of a non-empty list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">car</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">2</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cdaar))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cdaar%29%29" class="RktValDef RktValLink" data-pltdoc="x">cdaar</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">LISP-style selector: <span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">w</span></td></tr><tr><td><p><span class="RktRes">(list (list (list (list "bye") 3) #true) 42)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cdaar</span><span class="hspace">&nbsp;</span><span class="RktSym">w</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 3)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cdadr))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cdadr%29%29" class="RktValDef RktValLink" data-pltdoc="x">cdadr</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">LISP-style selector: <span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cdadr</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">"a"</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list "a")</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cdar))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cdar%29%29" class="RktValDef RktValLink" data-pltdoc="x">cdar</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">LISP-style selector: <span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">y</span></td></tr><tr><td><p><span class="RktRes">(list (list (list 1 2 3) #false "world"))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cdar</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list #false "world")</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cddar))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cddar%29%29" class="RktValDef RktValLink" data-pltdoc="x">cddar</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">LISP-style selector: <span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">car</span><span class="stt"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span>
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">w</span></td></tr><tr><td><p><span class="RktRes">(list (list (list (list "bye") 3) #true) 42)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cddar</span><span class="hspace">&nbsp;</span><span class="RktSym">w</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'()</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cdddr))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cdddr%29%29" class="RktValDef RktValLink" data-pltdoc="x">cdddr</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">LISP-style selector: <span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">v</span></td></tr><tr><td><p><span class="RktRes">(list 1 2 3 4 5 6 7 8 9 'A)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cdddr</span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 4 5 6 7 8 9 'A)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cddr))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cddr%29%29" class="RktValDef RktValLink" data-pltdoc="x">cddr</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">LISP-style selector: <span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="stt"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cddr</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list #true)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cdr))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cdr%29%29" class="RktValDef RktValLink" data-pltdoc="x">cdr</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">cons?</span></td></tr></table></blockquote></div><div class="SIntrapara">Selects the rest of a non-empty list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cdr</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list "hello" #true)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cons))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cons%29%29" class="RktValDef RktValLink" data-pltdoc="x">cons</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a list.
In ASL, <span class="RktSym">cons</span> creates a mutable list.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._cons~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._cons~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">cons?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is a constructed list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cons?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">cons?</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._eighth))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._eighth%29%29" class="RktValDef RktValLink" data-pltdoc="x">eighth</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Selects the eighth item of a non-empty list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">v</span></td></tr><tr><td><p><span class="RktRes">(list 1 2 3 4 5 6 7 8 9 'A)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">eighth</span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">8</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._empty~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._empty~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">empty?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is the empty list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">empty?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">empty?</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._fifth))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._fifth%29%29" class="RktValDef RktValLink" data-pltdoc="x">fifth</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Selects the fifth item of a non-empty list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">v</span></td></tr><tr><td><p><span class="RktRes">(list 1 2 3 4 5 6 7 8 9 'A)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">fifth</span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">5</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._first))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._first%29%29" class="RktValDef RktValLink" data-pltdoc="x">first</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">cons?</span></td></tr></table></blockquote></div><div class="SIntrapara">Selects the first item of a non-empty list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">first</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">2</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._fourth))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._fourth%29%29" class="RktValDef RktValLink" data-pltdoc="x">fourth</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Selects the fourth item of a non-empty list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">v</span></td></tr><tr><td><p><span class="RktRes">(list 1 2 3 4 5 6 7 8 9 'A)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">fourth</span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">4</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._length))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._length%29%29" class="RktValDef RktValLink" data-pltdoc="x">length</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">natural-number?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Evaluates the number of items on a list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">length</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">3</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._list))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list%29%29" class="RktValDef RktValLink" data-pltdoc="x">list</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a list of its arguments.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">6</span><span class="hspace">&nbsp;</span><span class="RktVal">7</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(cons 1 (cons 2 (cons 3 (cons 4 (cons 5 (cons 6 (cons 7 (cons 8 (cons 9 (cons 0 '()))))))))))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._list*))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list%2A%29%29" class="RktValDef RktValLink" data-pltdoc="x">list*</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">any</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">any</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a list by adding multiple items to a list.
In ASL, <span class="RktSym">list*</span> also deals with cyclic lists.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._list-ref))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list-ref%29%29" class="RktValDef RktValLink" data-pltdoc="x">list-ref</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">i</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">natural?</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the indexed item from the list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">v</span></td></tr><tr><td><p><span class="RktRes">(list 1 2 3 4 5 6 7 8 9 'A)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">list-ref</span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'A</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._list~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">list?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Checks whether the given value is a list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">list?</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">list?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">list?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._make-list))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-list%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-list</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">natural-number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a list of <span class="RktVar">i</span> copies of <span class="RktVar">x</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-list</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(cons "hello" (cons "hello" (cons "hello" '())))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._member))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._member%29%29" class="RktValDef RktValLink" data-pltdoc="x">member</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is on the list (comparing values with equal?).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">member</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._member~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._member~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">member?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is on the list (comparing values with equal?).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">member?</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._memq))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._memq%29%29" class="RktValDef RktValLink" data-pltdoc="x">memq</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value <span class="RktVar">x</span> is on some list <span class="RktVar">l</span>,
using <span class="RktSym">eq?</span> to compare <span class="RktVar">x</span> with items on <span class="RktVar">l</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">memq</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._memq~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._memq~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">memq?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value <span class="RktVar">x</span> is on some list <span class="RktVar">l</span>,
using <span class="RktSym">eq?</span> to compare <span class="RktVar">x</span> with items on <span class="RktVar">l</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">memq?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._memv))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._memv%29%29" class="RktValDef RktValLink" data-pltdoc="x">memv</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">or/c</span><span class="hspace">&nbsp;</span><span class="RktVal">#false</span><span class="hspace">&nbsp;</span><span class="RktSym">list</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is on the list if so, it produces the
suffix of the list that starts with x if not, it produces false. (It
compares values with the eqv? predicate.)
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">memv</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._null))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._null%29%29" class="RktValDef RktValLink" data-pltdoc="x">null</a></span></span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Another name for the empty list
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">null</span></td></tr><tr><td><p><span class="RktRes">'()</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._null~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._null~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">null?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is the empty list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">null?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">null?</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._range))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._range%29%29" class="RktValDef RktValLink" data-pltdoc="x">range</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">start</span><span class="hspace">&nbsp;</span><span class="RktVar">end</span><span class="hspace">&nbsp;</span><span class="RktVar">step</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">start</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">end</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">step</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a list of numbers by <span class="RktVar">step</span>ping from <span class="RktVar">start</span>
to <span class="RktVar">end</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">range</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(cons 0 (cons 2 (cons 4 (cons 6 (cons 8 '())))))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._remove))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._remove%29%29" class="RktValDef RktValLink" data-pltdoc="x">remove</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a list like the given one, with the first occurrence of the
given item removed (comparing values with equal?).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">remove</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 2 #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">hello-2</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true "hello")</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">remove</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktSym">hello-2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 2 #true "hello")</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._remove-all))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._remove-all%29%29" class="RktValDef RktValLink" data-pltdoc="x">remove-all</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a list like the given one, with all occurrences of the
given item removed (comparing values with equal?).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">remove-all</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 2 #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">hello-2</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true "hello")</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">remove-all</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktSym">hello-2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 2 #true)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._rest))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._rest%29%29" class="RktValDef RktValLink" data-pltdoc="x">rest</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">cons?</span></td></tr></table></blockquote></div><div class="SIntrapara">Selects the rest of a non-empty list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">rest</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list "hello" #true)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._reverse))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._reverse%29%29" class="RktValDef RktValLink" data-pltdoc="x">reverse</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">list</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a reversed version of a list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">reverse</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list #true "hello" 2)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._second))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._second%29%29" class="RktValDef RktValLink" data-pltdoc="x">second</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Selects the second item of a non-empty list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">second</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"hello"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._seventh))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._seventh%29%29" class="RktValDef RktValLink" data-pltdoc="x">seventh</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Selects the seventh item of a non-empty list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">v</span></td></tr><tr><td><p><span class="RktRes">(list 1 2 3 4 5 6 7 8 9 'A)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">seventh</span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">7</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._sixth))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sixth%29%29" class="RktValDef RktValLink" data-pltdoc="x">sixth</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Selects the sixth item of a non-empty list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">v</span></td></tr><tr><td><p><span class="RktRes">(list 1 2 3 4 5 6 7 8 9 'A)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">sixth</span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">6</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._third))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._third%29%29" class="RktValDef RktValLink" data-pltdoc="x">third</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Selects the third item of a non-empty list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">x</span></td></tr><tr><td><p><span class="RktRes">(list 2 "hello" #true)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">third</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Posns&quot;">5.10<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Posns)"></a>Posns</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._make-posn))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-posn%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-posn</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">posn</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a posn from two arbitrary values.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-posn</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-posn 3 3)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-posn</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVal">#true</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-posn "hello" #true)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._posn-x))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._posn-x%29%29" class="RktValDef RktValLink" data-pltdoc="x">posn-x</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">posn</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the x component of a posn.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">p</span></td></tr><tr><td><p><span class="RktRes">(make-posn 2 -3)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">posn-x</span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">2</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._posn-y))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._posn-y%29%29" class="RktValDef RktValLink" data-pltdoc="x">posn-y</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">posn</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the y component of a posn.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">p</span></td></tr><tr><td><p><span class="RktRes">(make-posn 2 -3)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">posn-y</span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">-3</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._posn~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._posn~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">posn?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if its input is a posn.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">q</span></td></tr><tr><td><p><span class="RktRes">(make-posn "bye" 2)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">posn?</span><span class="hspace">&nbsp;</span><span class="RktSym">q</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">posn?</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._set-posn-x!))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._set-posn-x%21%29%29" class="RktValDef RktValLink" data-pltdoc="x">set-posn-x!</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">posn</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Updates the x component of a posn.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">p</span></td></tr><tr><td><p><span class="RktRes">(make-posn 2 -3)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">set-posn-x!</span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span><span class="RktVal">678</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktVar">p</span></td></tr><tr><td><p><span class="RktRes">(make-posn 678 -3)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._set-posn-y!))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._set-posn-y%21%29%29" class="RktValDef RktValLink" data-pltdoc="x">set-posn-y!</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">posn</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Updates the y component of a posn.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">q</span></td></tr><tr><td><p><span class="RktRes">(make-posn "bye" 2)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">set-posn-y!</span><span class="hspace">&nbsp;</span><span class="RktSym">q</span><span class="hspace">&nbsp;</span><span class="RktVal">678</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">q</span></td></tr><tr><td><p><span class="RktRes">(make-posn "bye" 678)</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Characters&quot;">5.11<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Characters)"></a>Characters</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char-~3einteger))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-~3einteger%29%29" class="RktValDef RktValLink" data-pltdoc="x">char-&gt;integer</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Looks up the number that corresponds to the given character in the ASCII table (if any).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-&gt;integer</span><span class="hspace">&nbsp;</span><span class="RktVal">#\a</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">97</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-&gt;integer</span><span class="hspace">&nbsp;</span><span class="RktVal">#\z</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">122</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char-alphabetic~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-alphabetic~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char-alphabetic?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether a character represents an alphabetic character.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-alphabetic?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\Q</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char-ci~3c~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-ci~3c~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char-ci&lt;=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the characters are ordered in an increasing and case-insensitive manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-ci&lt;=?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\b</span><span class="hspace">&nbsp;</span><span class="RktVal">#\B</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char&lt;=?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\b</span><span class="hspace">&nbsp;</span><span class="RktVal">#\B</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char-ci~3c~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-ci~3c~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char-ci&lt;?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the characters are ordered in a strictly increasing and case-insensitive manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-ci&lt;?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\B</span><span class="hspace">&nbsp;</span><span class="RktVal">#\c</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char&lt;?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\b</span><span class="hspace">&nbsp;</span><span class="RktVal">#\B</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char-ci~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-ci~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char-ci=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether two characters are equal in a case-insensitive
manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-ci=?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\b</span><span class="hspace">&nbsp;</span><span class="RktVal">#\B</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char-ci~3e~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-ci~3e~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char-ci&gt;=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the characters are sorted in a decreasing and case-insensitive manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-ci&gt;=?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\b</span><span class="hspace">&nbsp;</span><span class="RktVal">#\C</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char&gt;=?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\b</span><span class="hspace">&nbsp;</span><span class="RktVal">#\C</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char-ci~3e~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-ci~3e~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char-ci&gt;?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the characters are sorted in a strictly decreasing and case-insensitive manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-ci&gt;?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\b</span><span class="hspace">&nbsp;</span><span class="RktVal">#\B</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char&gt;?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\b</span><span class="hspace">&nbsp;</span><span class="RktVal">#\B</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char-downcase))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-downcase%29%29" class="RktValDef RktValLink" data-pltdoc="x">char-downcase</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">char</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces the equivalent lower-case character.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-downcase</span><span class="hspace">&nbsp;</span><span class="RktVal">#\T</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#\t</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char-lower-case~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-lower-case~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char-lower-case?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether a character is a lower-case character.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-lower-case?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\T</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char-numeric~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-numeric~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char-numeric?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether a character represents a digit.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-numeric?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\9</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char-upcase))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-upcase%29%29" class="RktValDef RktValLink" data-pltdoc="x">char-upcase</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">char</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces the equivalent upper-case character.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-upcase</span><span class="hspace">&nbsp;</span><span class="RktVal">#\t</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#\T</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char-upper-case~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-upper-case~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char-upper-case?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether a character is an upper-case character.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-upper-case?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\T</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char-whitespace~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char-whitespace~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char-whitespace?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether a character represents space.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char-whitespace?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\tab</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char~3c~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char~3c~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char&lt;=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the characters are ordered in an increasing manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char&lt;=?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\a</span><span class="hspace">&nbsp;</span><span class="RktVal">#\a</span><span class="hspace">&nbsp;</span><span class="RktVal">#\b</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char~3c~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char~3c~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char&lt;?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the characters are ordered in a strictly increasing manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char&lt;?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\a</span><span class="hspace">&nbsp;</span><span class="RktVal">#\b</span><span class="hspace">&nbsp;</span><span class="RktVal">#\c</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the characters are equal.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char=?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\b</span><span class="hspace">&nbsp;</span><span class="RktVal">#\a</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char~3e~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char~3e~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char&gt;=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the characters are sorted in a decreasing manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char&gt;=?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\b</span><span class="hspace">&nbsp;</span><span class="RktVal">#\b</span><span class="hspace">&nbsp;</span><span class="RktVal">#\a</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char~3e~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char~3e~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char&gt;?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">d</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">e</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the characters are sorted in a strictly decreasing manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char&gt;?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\A</span><span class="hspace">&nbsp;</span><span class="RktVal">#\z</span><span class="hspace">&nbsp;</span><span class="RktVal">#\a</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._char~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._char~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">char?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether a value is a character.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char?</span><span class="hspace">&nbsp;</span><span class="RktVal">"a"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">char?</span><span class="hspace">&nbsp;</span><span class="RktVal">#\a</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Strings&quot;">5.12<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Strings)"></a>Strings</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._explode))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._explode%29%29" class="RktValDef RktValLink" data-pltdoc="x">explode</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">string</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Translates a string into a list of 1-letter strings.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">explode</span><span class="hspace">&nbsp;</span><span class="RktVal">"cat"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list "c" "a" "t")</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._format))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._format%29%29" class="RktValDef RktValLink" data-pltdoc="x">format</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Formats a string, possibly embedding values.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">format</span><span class="hspace">&nbsp;</span><span class="RktVal">"Dear Dr. ~a:"</span><span class="hspace">&nbsp;</span><span class="RktVal">"Flatt"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"Dear Dr. Flatt:"</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">format</span><span class="hspace">&nbsp;</span><span class="RktVal">"Dear Dr. ~s:"</span><span class="hspace">&nbsp;</span><span class="RktVal">"Flatt"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"Dear Dr. \"Flatt\":"</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">format</span><span class="hspace">&nbsp;</span><span class="RktVal">"the value of ~s is ~a"</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">+</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"the value of (+ 1 1) is 2"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._implode))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._implode%29%29" class="RktValDef RktValLink" data-pltdoc="x">implode</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Concatenates the list of 1-letter strings into one string.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">implode</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">"c"</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">"a"</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">"t"</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"cat"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._int-~3estring))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._int-~3estring%29%29" class="RktValDef RktValLink" data-pltdoc="x">int-&gt;string</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">i</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></td></tr></table></blockquote></div><div class="SIntrapara">Converts an integer in [0,55295] or [57344 1114111] to a 1-letter string.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">int-&gt;string</span><span class="hspace">&nbsp;</span><span class="RktVal">65</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"A"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._list-~3estring))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list-~3estring%29%29" class="RktValDef RktValLink" data-pltdoc="x">list-&gt;string</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">list?</span></td></tr></table></blockquote></div><div class="SIntrapara">Converts a s list of characters into a string.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">list-&gt;string</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">#\c</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">#\a</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">#\t</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"cat"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._make-string))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-string%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-string</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">natural-number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a string of length <span class="RktVar">i</span> from <span class="RktVar">c</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-string</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">#\d</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"ddd"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._replicate))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._replicate%29%29" class="RktValDef RktValLink" data-pltdoc="x">replicate</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">natural-number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Replicates <span class="RktVar">s</span> <span class="RktVar">i</span> times.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">replicate</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">"h"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"hhh"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string%29%29" class="RktValDef RktValLink" data-pltdoc="x">string</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">char</span></td></tr></table></blockquote></div><div class="SIntrapara">Builds a string of the given characters.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string</span><span class="hspace">&nbsp;</span><span class="RktVal">#\d</span><span class="hspace">&nbsp;</span><span class="RktVal">#\o</span><span class="hspace">&nbsp;</span><span class="RktVal">#\g</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"dog"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-~3eint))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-~3eint%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-&gt;int</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Converts a 1-letter string to an integer in [0,55295] or [57344, 1114111].
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-&gt;int</span><span class="hspace">&nbsp;</span><span class="RktVal">"a"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">97</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-~3elist))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-~3elist%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-&gt;list</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">char</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Converts a string into a list of characters.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-&gt;list</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list #\h #\e #\l #\l #\o)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-~3enumber))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-~3enumber%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-&gt;number</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">union</span><span class="hspace">&nbsp;</span><span class="RktSym">number</span><span class="hspace">&nbsp;</span><span class="RktVal">#false</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Converts a string into a number, produce false if impossible.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-&gt;number</span><span class="hspace">&nbsp;</span><span class="RktVal">"-2.03"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#i-2.03</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-&gt;number</span><span class="hspace">&nbsp;</span><span class="RktVal">"1-2i"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">1-2i</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-~3esymbol))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-~3esymbol%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-&gt;symbol</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">symbol</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Converts a string into a symbol.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-&gt;symbol</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'hello</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-alphabetic~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-alphabetic~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-alphabetic?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether all &rsquo;letters&rsquo; in the string are alphabetic.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-alphabetic?</span><span class="hspace">&nbsp;</span><span class="RktVal">"123"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-alphabetic?</span><span class="hspace">&nbsp;</span><span class="RktVal">"cat"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-contains-ci~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-contains-ci~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-contains-ci?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">t</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the first string appears in the second one without
 regard to the case of the letters.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-contains-ci?</span><span class="hspace">&nbsp;</span><span class="RktVal">"At"</span><span class="hspace">&nbsp;</span><span class="RktVal">"caT"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-contains~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-contains~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-contains?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">t</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the first string appears literally in the second one.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-contains?</span><span class="hspace">&nbsp;</span><span class="RktVal">"at"</span><span class="hspace">&nbsp;</span><span class="RktVal">"cat"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-copy))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-copy%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-copy</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Copies a string. </div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-copy</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"hello"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-downcase))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-downcase%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-downcase</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a string like the given one with all &rsquo;letters&rsquo; as lower case.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-downcase</span><span class="hspace">&nbsp;</span><span class="RktVal">"CAT"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"cat"</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-downcase</span><span class="hspace">&nbsp;</span><span class="RktVal">"cAt"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"cat"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-ith))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ith%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-ith</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">i</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">1string?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">natural-number</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the <span class="RktVar">i</span>th 1-letter substring from <span class="RktVar">s</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-ith</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello world"</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"e"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-length))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-length%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-length</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">nat</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the length of a string.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-length</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello world"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">11</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-lower-case~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-lower-case~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-lower-case?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether all &rsquo;letters&rsquo; in the string are lower case.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-lower-case?</span><span class="hspace">&nbsp;</span><span class="RktVal">"CAT"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-numeric~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-numeric~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-numeric?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether all &rsquo;letters&rsquo; in the string are numeric.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-numeric?</span><span class="hspace">&nbsp;</span><span class="RktVal">"123"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-numeric?</span><span class="hspace">&nbsp;</span><span class="RktVal">"1-2i"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-ref))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ref%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-ref</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">i</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">char</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">natural-number</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the <span class="RktVar">i</span>th character from <span class="RktVar">s</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-ref</span><span class="hspace">&nbsp;</span><span class="RktVal">"cat"</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#\t</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-upcase))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-upcase%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-upcase</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a string like the given one with all &rsquo;letters&rsquo; as upper case.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-upcase</span><span class="hspace">&nbsp;</span><span class="RktVal">"cat"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"CAT"</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-upcase</span><span class="hspace">&nbsp;</span><span class="RktVal">"cAt"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"CAT"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-upper-case~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-upper-case~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-upper-case?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether all &rsquo;letters&rsquo; in the string are upper case.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-upper-case?</span><span class="hspace">&nbsp;</span><span class="RktVal">"CAT"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-whitespace~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-whitespace~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-whitespace?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether all &rsquo;letters&rsquo; in the string are white space.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-whitespace?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">string-append</span><span class="hspace">&nbsp;</span><span class="RktVal">" "</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">string</span><span class="hspace">&nbsp;</span><span class="RktVal">#\tab</span><span class="hspace">&nbsp;</span><span class="RktVal">#\newline</span><span class="hspace">&nbsp;</span><span class="RktVal">#\return</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether a value is a string.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string?</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello world"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string?</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._substring))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._substring%29%29" class="RktValDef RktValLink" data-pltdoc="x">substring</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span><span class="RktVar">j</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">natural-number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">j</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">natural-number</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the substring starting at <span class="RktVar">i</span> up to <span class="RktVar">j</span> (or the
end if <span class="RktVar">j</span> is not provided).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">substring</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello world"</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"ello"</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">substring</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello world"</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"o world"</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Images&quot;">5.13<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Images)"></a>Images</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._image~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._image~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">image=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span><span class="RktVar">j</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">i</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">image</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">j</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">image</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether two images are equal.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">c1</span></td></tr><tr><td><p><img style="vertical-align: 0px; margin: -3px -3px -3px -3px;" src="pict_13.png" alt="image" width="27" height="27"/></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">image=?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">circle</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">"solid"</span><span class="hspace">&nbsp;</span><span class="RktVal">"green"</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">c1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">image=?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">circle</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="hspace">&nbsp;</span><span class="RktVal">"solid"</span><span class="hspace">&nbsp;</span><span class="RktVal">"green"</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">c1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._image~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._image~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">image?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether a value is an image.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">c1</span></td></tr><tr><td><p><img style="vertical-align: 0px; margin: -3px -3px -3px -3px;" src="pict_14.png" alt="image" width="27" height="27"/></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">image?</span><span class="hspace">&nbsp;</span><span class="RktSym">c1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Misc&quot;">5.14<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Misc)"></a>Misc</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._~3d~7e))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._~3d~7e%29%29" class="RktValDef RktValLink" data-pltdoc="x">=~</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span><span class="RktVar">eps</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">eps</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">non-negative-real</span></td></tr></table></blockquote></div><div class="SIntrapara">Checks
whether <span class="RktVar">x</span> and <span class="RktVar">y</span> are within <span class="RktVar">eps</span> of either other.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">=~</span><span class="hspace">&nbsp;</span><span class="RktVal">1.01</span><span class="hspace">&nbsp;</span><span class="RktVal">1.0</span><span class="hspace">&nbsp;</span><span class="RktVal">0.1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">=~</span><span class="hspace">&nbsp;</span><span class="RktVal">1.01</span><span class="hspace">&nbsp;</span><span class="RktVal">1.5</span><span class="hspace">&nbsp;</span><span class="RktVal">0.1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._current-milliseconds))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._current-milliseconds%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-milliseconds</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">exact-integer</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Returns the current &#8220;time&#8221; in fixnum milliseconds (possibly negative).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">current-milliseconds</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">1588368932156</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._eof))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._eof%29%29" class="RktValDef RktValLink" data-pltdoc="x">eof</a></span></span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">eof-object?</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A value that represents the end of a file:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">eof</span></td></tr><tr><td><p><span class="RktRes">#&lt;eof&gt;</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._eof-object~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._eof-object~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">eof-object?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is the end-of-file value.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">eof-object?</span><span class="hspace">&nbsp;</span><span class="RktSym">eof</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">eof-object?</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._eq~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._eq~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">eq?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether two values are equivalent from the computer&rsquo;s perspective (intensional).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">eq?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">one</span></td></tr><tr><td><p><span class="RktRes">(list 1)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">eq?</span><span class="hspace">&nbsp;</span><span class="RktSym">one</span><span class="hspace">&nbsp;</span><span class="RktSym">one</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._equal~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._equal~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">equal?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether two values are structurally equal where basic values
are compared with the eqv? predicate.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">equal?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-posn</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-posn</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-</span></span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._equal~7e~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._equal~7e~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">equal~?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span><span class="RktVar">z</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">z</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">non-negative-real</span></td></tr></table></blockquote></div><div class="SIntrapara">Compares <span class="RktVar">x</span> and <span class="RktVar">y</span> like <span class="RktSym">equal?</span> but uses =~ in the case of numbers.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">equal~?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-posn</span><span class="hspace">&nbsp;</span><span class="RktVal">1.01</span><span class="hspace">&nbsp;</span><span class="RktVal">1.0</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-posn</span><span class="hspace">&nbsp;</span><span class="RktVal">1.01</span><span class="hspace">&nbsp;</span><span class="RktVal">0.99</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">0.2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._eqv~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._eqv~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">eqv?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether two values are equivalent from the perspective of all
functions that can be applied to it (extensional).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">eqv?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">one</span></td></tr><tr><td><p><span class="RktRes">(list 1)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">eqv?</span><span class="hspace">&nbsp;</span><span class="RktSym">one</span><span class="hspace">&nbsp;</span><span class="RktSym">one</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._error))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._error%29%29" class="RktValDef RktValLink" data-pltdoc="x">error</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Signals an error, combining the given values
into an error message. If any of the values&rsquo;
printed representations is too long, it is
truncated and &ldquo;...&rdquo; is put into the string.
If the first value is a symbol, it is suffixed with a colon and the
result pre-pended on to the error message.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">zero</span></td></tr><tr><td><p><span class="RktRes">0</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">if</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">=</span><span class="hspace">&nbsp;</span><span class="RktSym">zero</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">error</span><span class="hspace">&nbsp;</span><span class="RktVal">"can't divide by 0"</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">/</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktSym">zero</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">can't divide by 0</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._exit))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._exit%29%29" class="RktValDef RktValLink" data-pltdoc="x">exit</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Evaluating <span class="RktPn">(</span><span class="RktSym">exit</span><span class="RktPn">)</span> terminates the running program.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._force))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._force%29%29" class="RktValDef RktValLink" data-pltdoc="x">force</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">v</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Finds the delayed value; see also delay.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._gensym))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._gensym%29%29" class="RktValDef RktValLink" data-pltdoc="x">gensym</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">symbol?</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Generates a new symbol, different from all symbols in the program.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">gensym</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'g17940</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._identity))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._identity%29%29" class="RktValDef RktValLink" data-pltdoc="x">identity</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVar">x</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">identity</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">42</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">identity</span><span class="hspace">&nbsp;</span><span class="RktSym">c1</span><span class="RktPn">)</span></td></tr><tr><td><p><img style="vertical-align: 0px; margin: -3px -3px -3px -3px;" src="pict_15.png" alt="image" width="27" height="27"/></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">identity</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"hello"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._promise~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._promise~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">promise?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if a value is delayed.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._sleep))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sleep%29%29" class="RktValDef RktValLink" data-pltdoc="x">sleep</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">sec</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">sec</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">positive-num</span></td></tr></table></blockquote></div><div class="SIntrapara">Causes the program to sleep for the given number of seconds.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._struct~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._struct~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">struct?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether some value is a structure.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">struct?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">make-posn</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">struct?</span><span class="hspace">&nbsp;</span><span class="RktVal">43</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._void))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._void%29%29" class="RktValDef RktValLink" data-pltdoc="x">void</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void?</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Produces a void value.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">void</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._void~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._void~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">void?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if a value is void.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">void?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">void</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">void?</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Numbers__relaxed_conditions_&quot;">5.15<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Numbers__relaxed_conditions_)"></a>Numbers (relaxed conditions)</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._*))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._%2A%29%29" class="RktValDef RktValLink" data-pltdoc="x">*</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Multiplies all given numbers.
In ISL and up: <span class="RktSym">*</span> works when applied to only one number or none.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">*</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">15</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">*</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">30</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">*</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">2</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">*</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">1</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._+))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._%2B%29%29" class="RktValDef RktValLink" data-pltdoc="x">+</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Adds all given numbers.
In ISL and up: <span class="RktSym">+</span> works when applied to only one number or none.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktVal">2/3</span><span class="hspace">&nbsp;</span><span class="RktVal">1/16</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">35/48</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">18</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">1</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">+</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">0</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._/))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._%2F%29%29" class="RktValDef RktValLink" data-pltdoc="x">/</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">number</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">y</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr></table></blockquote></div><div class="SIntrapara">Divides the first by all remaining numbers.
In ISL and up: <span class="RktSym">/</span> computes the inverse when applied to one number.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">/</span><span class="hspace">&nbsp;</span><span class="RktVal">12</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">6</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">/</span><span class="hspace">&nbsp;</span><span class="RktVal">12</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">2</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">/</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">1/3</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;String__relaxed_conditions_&quot;">5.16<tt>&nbsp;</tt><a name="(part._htdp-advanced._.String__relaxed_conditions_)"></a>String (relaxed conditions)</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-append))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-append%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-append</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Concatenates the characters of several strings.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-append</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVal">" "</span><span class="hspace">&nbsp;</span><span class="RktVal">"world"</span><span class="hspace">&nbsp;</span><span class="RktVal">" "</span><span class="hspace">&nbsp;</span><span class="RktVal">"good bye"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"hello world good bye"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-ci~3c~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ci~3c~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-ci&lt;=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the strings are ordered in a lexicographically
increasing and case-insensitive manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-ci&lt;=?</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVal">"WORLD"</span><span class="hspace">&nbsp;</span><span class="RktVal">"zoo"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-ci~3c~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ci~3c~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-ci&lt;?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the strings are ordered in a lexicographically
strictly increasing and case-insensitive manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-ci&lt;?</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVal">"WORLD"</span><span class="hspace">&nbsp;</span><span class="RktVal">"zoo"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-ci~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ci~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-ci=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether all strings are equal, character for character, regardless of case.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-ci=?</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVal">"HellO"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-ci~3e~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ci~3e~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-ci&gt;=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the strings are ordered in a lexicographically
decreasing and case-insensitive manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-ci&gt;?</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">"zoo"</span><span class="hspace">&nbsp;</span><span class="RktVal">"WORLD"</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string-ci~3e~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string-ci~3e~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string-ci&gt;?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the strings are ordered in a lexicographically
strictly decreasing and case-insensitive manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-ci&gt;?</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">"zoo"</span><span class="hspace">&nbsp;</span><span class="RktVal">"WORLD"</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string~3c~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string~3c~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string&lt;=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the strings are ordered in a lexicographically increasing manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string&lt;=?</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVal">"world"</span><span class="hspace">&nbsp;</span><span class="RktVal">"zoo"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string~3c~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string~3c~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string&lt;?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the strings are ordered in a lexicographically strictly increasing manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string&lt;?</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVal">"world"</span><span class="hspace">&nbsp;</span><span class="RktVal">"zoo"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether all strings are equal, character for character.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string=?</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVal">"world"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string=?</span><span class="hspace">&nbsp;</span><span class="RktVal">"bye"</span><span class="hspace">&nbsp;</span><span class="RktVal">"bye"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string~3e~3d~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string~3e~3d~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string&gt;=?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the strings are ordered in a lexicographically decreasing manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string&gt;=?</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">"zoo"</span><span class="hspace">&nbsp;</span><span class="RktVal">"zoo"</span><span class="hspace">&nbsp;</span><span class="RktVal">"world"</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._string~3e~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._string~3e~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">string&gt;?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">t</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether the strings are ordered in a lexicographically strictly decreasing manner.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string&gt;?</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktVal">"zoo"</span><span class="hspace">&nbsp;</span><span class="RktVal">"world"</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Posn&quot;">5.17<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Posn)"></a>Posn</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._posn))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._posn%29%29" class="RktValDef RktValLink" data-pltdoc="x">posn</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">signature</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Signature for posns.</div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Higher-Order_Functions&quot;">5.18<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Higher-.Order_.Functions)"></a>Higher-Order Functions</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._andmap))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._andmap%29%29" class="RktValDef RktValLink" data-pltdoc="x">andmap</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">p?</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">...</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">boolean</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether <span class="RktVar">p?</span> holds for all items of <span class="RktVar">l</span> ...:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">andmap</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">p</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">=</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">and</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">p</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">p</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">andmap</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">p</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">=</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">and</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">p</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-1</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">p</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">andmap</span><span class="hspace">&nbsp;</span><span class="RktSym">odd?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">7</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">andmap</span><span class="hspace">&nbsp;</span><span class="RktSym">even?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote><p><div class="SIntrapara">Making sure all numbers are below some threshold:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">small-enough?</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">&lt;</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">small-enough?:this name was defined previously and cannot be re-defined</span></p></td></tr></table></blockquote></div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">andmap</span><span class="hspace">&nbsp;</span><span class="RktSym">small-enough?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote><p><div class="SIntrapara">Checking that all items in the first list satisfy the corresponding predictate in the 2nd:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">and-satisfies?</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">and-satisfies?:this name was defined previously and cannot be re-defined</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">andmap</span><span class="hspace">&nbsp;</span><span class="RktSym">and-satisfies?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktSym">odd?</span><span class="hspace">&nbsp;</span><span class="RktSym">even?</span><span class="hspace">&nbsp;</span><span class="RktSym">positive?</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._apply))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._apply%29%29" class="RktValDef RktValLink" data-pltdoc="x">apply</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span><span class="RktVar">x-1</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">Y</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X-1</span><span class="hspace">&nbsp;</span><span class="RktSym">...</span><span class="hspace">&nbsp;</span><span class="RktSym">X-N</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x-1</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X-1</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktSym">X-i+1</span><span class="hspace">&nbsp;</span><span class="RktSym">...</span><span class="hspace">&nbsp;</span><span class="RktSym">X-N</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Applies a function using items from a list as the arguments:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">apply</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">=</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">a-list</span></td></tr><tr><td><p><span class="RktRes">(list 0 1 2 3 4 5 6 7 8 9)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">apply</span><span class="hspace">&nbsp;</span><span class="RktSym">max</span><span class="hspace">&nbsp;</span><span class="RktSym">a-list</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">9</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._argmax))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._argmax%29%29" class="RktValDef RktValLink" data-pltdoc="x">argmax</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">X</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">real</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Finds the (first) element of the list that maximizes the output of the function.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">argmax</span><span class="hspace">&nbsp;</span><span class="RktSym">second</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">sam</span><span class="hspace">&nbsp;</span><span class="RktVal">98</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">carl</span><span class="hspace">&nbsp;</span><span class="RktVal">78</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">vincent</span><span class="hspace">&nbsp;</span><span class="RktVal">93</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">asumu</span><span class="hspace">&nbsp;</span><span class="RktVal">99</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 'asumu 99)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._argmin))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._argmin%29%29" class="RktValDef RktValLink" data-pltdoc="x">argmin</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">X</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">real</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Finds the (first) element of the list that minimizes the output of the function.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">argmin</span><span class="hspace">&nbsp;</span><span class="RktSym">second</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">sam</span><span class="hspace">&nbsp;</span><span class="RktVal">98</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">carl</span><span class="hspace">&nbsp;</span><span class="RktVal">78</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">vincent</span><span class="hspace">&nbsp;</span><span class="RktVal">93</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">asumu</span><span class="hspace">&nbsp;</span><span class="RktVal">99</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 'carl 78)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._build-list))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._build-list%29%29" class="RktValDef RktValLink" data-pltdoc="x">build-list</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">n</span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">n</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">nat</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">nat</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a list by applying <span class="RktVar">f</span> to the numbers between <span class="RktVal">0</span> and <span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-</span></span><span class="stt"> </span><span class="RktVar">n</span><span class="stt"> </span><span class="RktVal">1</span><span class="RktPn">)</span>:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">build-list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">n</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">f</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">=</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">0</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-</span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">n</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">build-list</span><span class="hspace">&nbsp;</span><span class="RktVal">22</span><span class="hspace">&nbsp;</span><span class="RktSym">add1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22)</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara">Creating a diagnoal matrix:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">diagonalize</span><span class="hspace">&nbsp;</span><span class="RktSym">i</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">local</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">off</span><span class="hspace">&nbsp;</span><span class="RktSym">j</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">if</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">=</span><span class="hspace">&nbsp;</span><span class="RktSym">i</span><span class="hspace">&nbsp;</span><span class="RktSym">j</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">build-list</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktSym">off</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">diagonalize:this name was defined previously and cannot be re-defined</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">build-list</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktSym">diagonalize</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list (list 1 0 0) (list 0 1 0) (list 0 0 1))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._build-string))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._build-string%29%29" class="RktValDef RktValLink" data-pltdoc="x">build-string</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">n</span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">string</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">n</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">nat</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">nat</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">char</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a string by applying <span class="RktVar">f</span> to the numbers between <span class="RktVal">0</span> and
<span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-</span></span><span class="stt"> </span><span class="RktVar">n</span><span class="stt"> </span><span class="RktVal">1</span><span class="RktPn">)</span>:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">build-string</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">n</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">f</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">=</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">string</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">0</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-</span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">n</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">build-string</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="hspace">&nbsp;</span><span class="RktSym">integer-&gt;char</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"\u0000\u0001\u0002\u0003\u0004\u0005\u0006\a\b\t"</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara">Making the alphabet:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">starting-at-a</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">integer-&gt;char</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktVal">65</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">starting-at-a:this name was defined previously and cannot be re-defined</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">build-string</span><span class="hspace">&nbsp;</span><span class="RktVal">26</span><span class="hspace">&nbsp;</span><span class="RktSym">starting-at-a</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"ABCDEFGHIJKLMNOPQRSTUVWXYZ"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._compose))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._compose%29%29" class="RktValDef RktValLink" data-pltdoc="x">compose</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span><span class="RktVar">g</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">Z</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">Y</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">Z</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">g</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Composes a sequence of procedures into a single procedure:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">compose</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">g</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div><div class="SIntrapara">is equivalent to
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">define</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f-after-g</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">g</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">map</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">compose</span><span class="hspace">&nbsp;</span><span class="RktSym">add1</span><span class="hspace">&nbsp;</span><span class="RktSym">second</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">add</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">sub</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">mul</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 4 3 5)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._filter))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._filter%29%29" class="RktValDef RktValLink" data-pltdoc="x">filter</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">p?</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">boolean</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a list from all those items on a list for which the predicate holds.</div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">filter</span><span class="hspace">&nbsp;</span><span class="RktSym">odd?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">6</span><span class="hspace">&nbsp;</span><span class="RktVal">7</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 1 3 5 7 9)</span></p></td></tr></table></blockquote><p><div class="SIntrapara">Keep only numbers that are large enough:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">large-enough?</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">&gt;=</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">large-enough?:this name was defined previously and cannot be re-defined</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">filter</span><span class="hspace">&nbsp;</span><span class="RktSym">large-enough?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">6</span><span class="hspace">&nbsp;</span><span class="RktVal">7</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 3 4 5 6 7 8 9)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._foldl))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._foldl%29%29" class="RktValDef RktValLink" data-pltdoc="x">foldl</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span><span class="RktVar">base</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">Y</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">...</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">base</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">Y</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foldl</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">base</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">=</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">base</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foldl</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">base</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktSym">=</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-n</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">base</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">foldl</span><span class="hspace">&nbsp;</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">6</span><span class="hspace">&nbsp;</span><span class="RktVal">7</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">45</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">foldl</span><span class="hspace">&nbsp;</span><span class="RktSym">cons</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">a</span><span class="hspace">&nbsp;</span><span class="RktVal">b</span><span class="hspace">&nbsp;</span><span class="RktVal">c</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 'c 'b 'a)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._foldr))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._foldr%29%29" class="RktValDef RktValLink" data-pltdoc="x">foldr</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span><span class="RktVar">base</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">Y</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">...</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">base</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">Y</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foldr</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">base</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">=</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">base</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">foldr</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">base</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktSym">=</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-n</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">base</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">foldr</span><span class="hspace">&nbsp;</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">6</span><span class="hspace">&nbsp;</span><span class="RktVal">7</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">45</span></p></td></tr></table></blockquote><p><div class="SIntrapara">Append all rests of all lists:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">append-rests</span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span><span class="RktSym">r</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">append</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">rest</span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">r</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">append-rests:this name was defined previously and cannot be re-defined</span></p></td></tr></table></blockquote></div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">foldr</span><span class="hspace">&nbsp;</span><span class="RktSym">append-rests</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">a</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">b</span><span class="hspace">&nbsp;</span><span class="RktVal">c</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">d</span><span class="hspace">&nbsp;</span><span class="RktVal">e</span><span class="hspace">&nbsp;</span><span class="RktVal">f</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 'a 'b 'c 'd 'e 'f)</span></p></td></tr></table></blockquote><p><div class="SIntrapara">Add two lists of numbers:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">add-two-lists</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">r</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">r</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">add-two-lists:this name was defined previously and cannot be re-defined</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">foldr</span><span class="hspace">&nbsp;</span><span class="RktSym">add-two-lists</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">10</span><span class="hspace">&nbsp;</span><span class="RktVal">11</span><span class="hspace">&nbsp;</span><span class="RktVal">12</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">39</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._map))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._map%29%29" class="RktValDef RktValLink" data-pltdoc="x">map</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">Z</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">...</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">Z</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a new list by applying a function to each item on one or
more existing lists:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">map</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">=</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">map</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">=</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-1</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">f</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">map</span><span class="hspace">&nbsp;</span><span class="RktSym">add1</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-4</span>.01</span><span class="hspace">&nbsp;</span><span class="RktVal">2/5</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 4 #i-3.01 1.4)</span></p></td></tr></table></blockquote><p><div class="SIntrapara">Mapping a user-defined function:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">tag-with-a</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktVal">"a"</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">tag-with-a:this name was defined previously and cannot be re-defined</span></p></td></tr></table></blockquote></div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">map</span><span class="hspace">&nbsp;</span><span class="RktSym">tag-with-a</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-4</span>.01</span><span class="hspace">&nbsp;</span><span class="RktVal">2/5</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list (list "a" 4) (list "a" #i-3.01) (list "a" 1.4))</span></p></td></tr></table></blockquote><p><div class="SIntrapara">Mapping over two lists:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">add-and-multiply</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">*</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">add-and-multiply:this name was defined previously and cannot be re-defined</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">map</span><span class="hspace">&nbsp;</span><span class="RktSym">add-and-multiply</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-4</span></span><span class="hspace">&nbsp;</span><span class="RktVal">2/5</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 6 -12 1.6)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._memf))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._memf%29%29" class="RktValDef RktValLink" data-pltdoc="x">memf</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">p?</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">union</span><span class="hspace">&nbsp;</span><span class="RktVal">#false</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">any</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces <span class="RktVal">#false</span> if <span class="RktVar">p?</span> produces <span class="RktSym">false</span> for all
items on <span class="RktVar">l</span>. If <span class="RktVar">p?</span> produces <span class="RktVal">#true</span> for any of
the items on <span class="RktVar">l</span>, <span class="RktSym">memf</span> returns the sub-list starting
from that item.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">memf</span><span class="hspace">&nbsp;</span><span class="RktSym">odd?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">6</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 3 8 0)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._ormap))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._ormap%29%29" class="RktValDef RktValLink" data-pltdoc="x">ormap</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">p?</span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">...</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">boolean</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines whether <span class="RktVar">p?</span> holds for at least one items of <span class="RktVar">l</span>:
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">ormap</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">p</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">=</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">or</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">p</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">p</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym">ormap</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">p</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">list</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">=</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">or</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">p</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-1</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-1</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">...</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">p</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x-n</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y-n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">ormap</span><span class="hspace">&nbsp;</span><span class="RktSym">odd?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">7</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">ormap</span><span class="hspace">&nbsp;</span><span class="RktSym">even?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara">Making sure at least one number is below some threshold:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">a-small-one?</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">&lt;</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">a-small-one?:this name was defined previously and cannot be re-defined</span></p></td></tr></table></blockquote></div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">ormap</span><span class="hspace">&nbsp;</span><span class="RktSym">a-small-one?</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">6</span><span class="hspace">&nbsp;</span><span class="RktVal">7</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote><p><div class="SIntrapara">Checking that one item in the first list satisfy the corresponding predictate in the 2nd:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">or-satisfies?</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">f</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">or-satisfies?:this name was defined previously and cannot be re-defined</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">ormap</span><span class="hspace">&nbsp;</span><span class="RktSym">or-satisfies?</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktSym">odd?</span><span class="hspace">&nbsp;</span><span class="RktSym">even?</span><span class="hspace">&nbsp;</span><span class="RktSym">positive?</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._procedure~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._procedure~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">procedure?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces true if the value is a procedure.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">procedure?</span><span class="hspace">&nbsp;</span><span class="RktSym">cons</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div></p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">procedure?</span><span class="hspace">&nbsp;</span><span class="RktSym">add1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote><p><div class="SIntrapara">Checking a programmer-defined function:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">define</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">my-function</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktErr">my-function:this name was defined previously and cannot be re-defined</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">procedure?</span><span class="hspace">&nbsp;</span><span class="RktSym">my-function</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._quicksort))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._quicksort%29%29" class="RktValDef RktValLink" data-pltdoc="x">quicksort</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span><span class="RktVar">comp</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">comp</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">boolean</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Sorts the items on <span class="RktVar">l</span>, in an order according to <span class="RktVar">comp</span> (using the quicksort
algorithm).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">quicksort</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">6</span><span class="hspace">&nbsp;</span><span class="RktVal">7</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktSym">&lt;</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 0 1 2 3 4 5 6 7 8 9)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._sort))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._sort%29%29" class="RktValDef RktValLink" data-pltdoc="x">sort</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span><span class="RktVar">comp</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">comp</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">boolean</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Sorts the items on <span class="RktVar">l</span>, in an order according to <span class="RktVar">comp</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">sort</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">6</span><span class="hspace">&nbsp;</span><span class="RktVal">7</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">4</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">9</span><span class="hspace">&nbsp;</span><span class="RktVal">8</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktSym">&lt;</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 0 1 2 3 4 5 6 7 8 9)</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Reading_and_Printing&quot;">5.19<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Reading_and_.Printing)"></a>Reading and Printing</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._display))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._display%29%29" class="RktValDef RktValLink" data-pltdoc="x">display</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Prints the argument to stdout (without quotes on symbols and strings, etc.).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">display</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">10</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">display</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">hello</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">display</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">hello</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">hello</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._newline))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._newline%29%29" class="RktValDef RktValLink" data-pltdoc="x">newline</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Prints a newline.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._pretty-print))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._pretty-print%29%29" class="RktValDef RktValLink" data-pltdoc="x">pretty-print</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Pretty prints S-expressions (like <span class="RktSym">write</span>).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">pretty-print</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">a</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">"hello world"</span><span class="hspace">&nbsp;</span><span class="RktVal">#true</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">false</span><span class="hspace">&nbsp;</span><span class="RktVal">"good bye"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">((1 2 3) ((a) ("hello world" #true) (((false "good bye")))))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">pretty-print</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">build-list</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">lambda</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">i</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">build-list</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">lambda</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">j</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">=</span><span class="hspace">&nbsp;</span><span class="RktSym">i</span><span class="hspace">&nbsp;</span><span class="RktSym">j</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktOut">((#true #false #false #false #false #false #false #false #false #false)</span></p></td></tr><tr><td><p><span class="RktOut"></span><span class="hspace">&nbsp;</span><span class="RktOut">(#false #true #false #false #false #false #false #false #false #false)</span></p></td></tr><tr><td><p><span class="RktOut"></span><span class="hspace">&nbsp;</span><span class="RktOut">(#false #false #true #false #false #false #false #false #false #false)</span></p></td></tr><tr><td><p><span class="RktOut"></span><span class="hspace">&nbsp;</span><span class="RktOut">(#false #false #false #true #false #false #false #false #false #false)</span></p></td></tr><tr><td><p><span class="RktOut"></span><span class="hspace">&nbsp;</span><span class="RktOut">(#false #false #false #false #true #false #false #false #false #false)</span></p></td></tr><tr><td><p><span class="RktOut"></span><span class="hspace">&nbsp;</span><span class="RktOut">(#false #false #false #false #false #true #false #false #false #false)</span></p></td></tr><tr><td><p><span class="RktOut"></span><span class="hspace">&nbsp;</span><span class="RktOut">(#false #false #false #false #false #false #true #false #false #false)</span></p></td></tr><tr><td><p><span class="RktOut"></span><span class="hspace">&nbsp;</span><span class="RktOut">(#false #false #false #false #false #false #false #true #false #false)</span></p></td></tr><tr><td><p><span class="RktOut"></span><span class="hspace">&nbsp;</span><span class="RktOut">(#false #false #false #false #false #false #false #false #true #false)</span></p></td></tr><tr><td><p><span class="RktOut"></span><span class="hspace">&nbsp;</span><span class="RktOut">(#false #false #false #false #false #false #false #false #false #true))</span></p></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._print))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._print%29%29" class="RktValDef RktValLink" data-pltdoc="x">print</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Prints the argument as a value.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">print</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">10</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">print</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">"hello"</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">print</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">hello</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">'hello</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._printf))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._printf%29%29" class="RktValDef RktValLink" data-pltdoc="x">printf</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Formats the rest of the arguments according to the first argument and print it. </div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._read))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._read%29%29" class="RktValDef RktValLink" data-pltdoc="x">read</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">sexp</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Reads input from the user.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._with-input-from-file))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._with-input-from-file%29%29" class="RktValDef RktValLink" data-pltdoc="x">with-input-from-file</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">any</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Opens the named input file <span class="RktVar">f</span> and allows <span class="RktVar">p</span> to read from it.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._with-input-from-string))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._with-input-from-string%29%29" class="RktValDef RktValLink" data-pltdoc="x">with-input-from-string</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">s</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">any</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Turns <span class="RktVar">s</span> into input for <span class="RktSym">read</span> operations in <span class="RktVar">p</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">with-input-from-string</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktSym">read</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'hello</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">string-length</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">symbol-&gt;string</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">with-input-from-string</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktSym">read</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">5</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._with-output-to-file))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._with-output-to-file%29%29" class="RktValDef RktValLink" data-pltdoc="x">with-output-to-file</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">string</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">any</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Opens the named output file <span class="RktVar">f</span> and allows <span class="RktVar">p</span> to write to it.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._with-output-to-string))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._with-output-to-string%29%29" class="RktValDef RktValLink" data-pltdoc="x">with-output-to-string</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">p</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">p</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">any</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a string from all write/display/print operations in <span class="RktVar">p</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">with-output-to-string</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">lambda</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">display</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"10"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._write))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._write%29%29" class="RktValDef RktValLink" data-pltdoc="x">write</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Prints the argument to stdout (in a traditional style that is somewhere
between <span class="RktSym">print</span> and <span class="RktSym">display</span>).
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">write</span><span class="hspace">&nbsp;</span><span class="RktVal">10</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">10</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">write</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">"hello"</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">write</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">hello</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">hello</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Vectors&quot;">5.20<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Vectors)"></a>Vectors</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._build-vector))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._build-vector%29%29" class="RktValDef RktValLink" data-pltdoc="x">build-vector</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">n</span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">vectorof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">n</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">nat</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">nat</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a vector by applying <span class="RktVar">f</span> to the numbers <span class="RktVal">0</span> through
<span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-</span></span><span class="stt"> </span><span class="RktVar">n</span><span class="stt"> </span><span class="RktVal">1</span><span class="RktPn">)</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">build-vector</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktSym">add1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(vector 1 2 3 4 5)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._list-~3evector))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._list-~3evector%29%29" class="RktValDef RktValLink" data-pltdoc="x">list-&gt;vector</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">l</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">vectorof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">l</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Transforms <span class="RktVar">l</span> into a vector.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">list-&gt;vector</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">list</span><span class="hspace">&nbsp;</span><span class="RktVal">"hello"</span><span class="hspace">&nbsp;</span><span class="RktVal">"world"</span><span class="hspace">&nbsp;</span><span class="RktVal">"good"</span><span class="hspace">&nbsp;</span><span class="RktVal">"bye"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(vector "hello" "world" "good" "bye")</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._make-vector))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-vector%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-vector</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">n</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">vectorof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">n</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">number</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a vector of <span class="RktVar">n</span> copies of <span class="RktVar">x</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-vector</span><span class="hspace">&nbsp;</span><span class="RktVal">5</span><span class="hspace">&nbsp;</span><span class="RktVal">0</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(vector 0 0 0 0 0)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._vector))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector%29%29" class="RktValDef RktValLink" data-pltdoc="x">vector</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">vector</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">...</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a vector from the given values.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">vector</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-1</span></span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-2</span></span><span class="hspace">&nbsp;</span><span class="RktVal"><span class="nobreak">-3</span></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(vector 1 2 3 -1 -2 -3)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._vector-~3elist))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector-~3elist%29%29" class="RktValDef RktValLink" data-pltdoc="x">vector-&gt;list</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">v</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">vectorof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Transforms <span class="RktVar">v</span> into a list.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">vector-&gt;list</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">vector</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">a</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">b</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">c</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list 'a 'b 'c)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._vector-length))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector-length%29%29" class="RktValDef RktValLink" data-pltdoc="x">vector-length</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">nat</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">v</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">vector</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the length of <span class="RktVar">v</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">v</span></td></tr><tr><td><p><span class="RktRes">(vector "a" "b" "c" "d" "e")</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">vector-length</span><span class="hspace">&nbsp;</span><span class="RktVar">v</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">5</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._vector-ref))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector-ref%29%29" class="RktValDef RktValLink" data-pltdoc="x">vector-ref</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">v</span><span class="hspace">&nbsp;</span><span class="RktVar">n</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">X</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">v</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">vector</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">n</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">nat</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the <span class="RktVar">n</span>th element from <span class="RktVar">v</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">v</span></td></tr><tr><td><p><span class="RktRes">(vector "a" "b" "c" "d" "e")</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">vector-ref</span><span class="hspace">&nbsp;</span><span class="RktVar">v</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"d"</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._vector-set!))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector-set%21%29%29" class="RktValDef RktValLink" data-pltdoc="x">vector-set!</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">v</span><span class="hspace">&nbsp;</span><span class="RktVar">n</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">v</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">vectorof</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">n</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">nat</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X</span></td></tr></table></blockquote></div><div class="SIntrapara">Updates <span class="RktVar">v</span> at position <span class="RktVar">n</span> to be <span class="RktVar">x</span>.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">v</span></td></tr><tr><td><p><span class="RktRes">(vector "a" "b" "c" "d" "e")</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">vector-set!</span><span class="hspace">&nbsp;</span><span class="RktVar">v</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="hspace">&nbsp;</span><span class="RktVal">77</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktVar">v</span></td></tr><tr><td><p><span class="RktRes">(vector "a" "b" "c" 77 "e")</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._vector~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._vector~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">vector?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if a value is a vector.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">v</span></td></tr><tr><td><p><span class="RktRes">(vector "a" "b" "c" 77 "e")</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">vector?</span><span class="hspace">&nbsp;</span><span class="RktSym">v</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">vector?</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Boxes&quot;">5.21<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Boxes)"></a>Boxes</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._box))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._box%29%29" class="RktValDef RktValLink" data-pltdoc="x">box</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">box?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a box.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">box</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(box 42)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._box~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._box~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">box?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if a value is a box.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">b</span></td></tr><tr><td><p><span class="RktRes">(box 33)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">box?</span><span class="hspace">&nbsp;</span><span class="RktSym">b</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">box?</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._set-box!))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._set-box%21%29%29" class="RktValDef RktValLink" data-pltdoc="x">set-box!</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">b</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">b</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">box?</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any/c</span></td></tr></table></blockquote></div><div class="SIntrapara">Updates a box.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">b</span></td></tr><tr><td><p><span class="RktRes">(box 33)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">set-box!</span><span class="hspace">&nbsp;</span><span class="RktVar">b</span><span class="hspace">&nbsp;</span><span class="RktVal">31</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktVar">b</span></td></tr><tr><td><p><span class="RktRes">(box 31)</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._unbox))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._unbox%29%29" class="RktValDef RktValLink" data-pltdoc="x">unbox</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">b</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">any</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">b</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">box?</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the boxed value.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktVar">b</span></td></tr><tr><td><p><span class="RktRes">(box 31)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">unbox</span><span class="hspace">&nbsp;</span><span class="RktVar">b</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">31</span></p></td></tr></table></blockquote></div></p><h4 x-source-module="(lib &quot;scribblings/htdp-langs/htdp-langs.scrbl&quot;)" x-source-pkg="htdp-doc" x-part-prefixes="(&quot;htdp-advanced&quot;)" x-part-tag="&quot;Hash_Tables&quot;">5.22<tt>&nbsp;</tt><a name="(part._htdp-advanced._.Hash_.Tables)"></a>Hash Tables</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-copy))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-copy%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-copy</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">hash</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">hash</span></td></tr></table></blockquote></div><div class="SIntrapara">Copies a hash table.</div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-count))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-count%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-count</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">integer</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">hash</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines the number of keys mapped by a hash table.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">ish</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hash (list (cons 'e 61) (cons 'r 999) (cons 'c 42) (cons 'b 69)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-count</span><span class="hspace">&nbsp;</span><span class="RktSym">ish</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">4</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-eq~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-eq~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-eq?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">hash</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if a hash table uses eq? for comparisons.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">hsh</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'e 61) (cons 'r 999) (cons 'b 69) (cons 'c 42)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-eq?</span><span class="hspace">&nbsp;</span><span class="RktSym">hsh</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">heq</span></td></tr><tr><td><p><span class="RktRes">(make-hasheq (list (cons 'b 69) (cons 'c 42) (cons 'e 61) (cons 'r 999)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-eq?</span><span class="hspace">&nbsp;</span><span class="RktSym">heq</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-equal~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-equal~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-equal?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">hash?</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if a hash table uses equal? for comparisons.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">ish</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hash (list (cons 'e 61) (cons 'r 999) (cons 'c 42) (cons 'b 69)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-equal?</span><span class="hspace">&nbsp;</span><span class="RktSym">ish</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">ieq</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hasheq (list (cons 'e 61) (cons 'r 999) (cons 'c 42) (cons 'b 69)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-equal?</span><span class="hspace">&nbsp;</span><span class="RktSym">ieq</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-eqv~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-eqv~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-eqv?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">hash</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if a hash table uses eqv? for comparisons.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">heq</span></td></tr><tr><td><p><span class="RktRes">(make-hasheq (list (cons 'b 69) (cons 'c 42) (cons 'e 61) (cons 'r 999)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-eqv?</span><span class="hspace">&nbsp;</span><span class="RktSym">heq</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">heqv</span></td></tr><tr><td><p><span class="RktRes">(make-hasheqv (list (cons 'b 69) (cons 'c 42) (cons 'e 61) (cons 'r 999)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-eqv?</span><span class="hspace">&nbsp;</span><span class="RktSym">heqv</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-for-each))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-for-each%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-for-each</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">any</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Applies a function to each mapping of a hash table for effect only.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">hsh</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'e 61) (cons 'r 999) (cons 'b 69) (cons 'c 42)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-for-each</span><span class="hspace">&nbsp;</span><span class="RktSym">hsh</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">lambda</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">ky</span><span class="hspace">&nbsp;</span><span class="RktSym">vl</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash-set!</span><span class="hspace">&nbsp;</span><span class="RktSym">hsh</span><span class="hspace">&nbsp;</span><span class="RktSym">ky</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktSym">vl</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">hsh</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'e 62) (cons 'r 1000) (cons 'b 70) (cons 'c 43)))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-has-key~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-has-key~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-has-key?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if a key is associated with a value in a hash table.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">ish</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hash (list (cons 'e 61) (cons 'r 999) (cons 'c 42) (cons 'b 69)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-has-key?</span><span class="hspace">&nbsp;</span><span class="RktSym">ish</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">b</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">hsh</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'e 62) (cons 'r 1000) (cons 'b 70) (cons 'c 43)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-has-key?</span><span class="hspace">&nbsp;</span><span class="RktSym">hsh</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">d</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-map))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-map%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-map</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">listof</span><span class="hspace">&nbsp;</span><span class="RktSym">Z</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">Z</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a new list by applying a function to each mapping of a hash
table.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">ish</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hash (list (cons 'e 61) (cons 'r 999) (cons 'c 42) (cons 'b 69)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-map</span><span class="hspace">&nbsp;</span><span class="RktSym">ish</span><span class="hspace">&nbsp;</span><span class="RktSym">list</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(list (list 'e 61) (list 'r 999) (list 'c 42) (list 'b 69))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-ref))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-ref%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-ref</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span><span class="RktVar">k</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">Y</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">k</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the value associated with a key from a hash table; the three
argument case allows a default value or default value computation.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">hsh</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'e 62) (cons 'r 1000) (cons 'b 70) (cons 'c 43)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-ref</span><span class="hspace">&nbsp;</span><span class="RktSym">hsh</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">b</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">70</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-ref!))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-ref%21%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-ref!</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span><span class="RktVar">k</span><span class="hspace">&nbsp;</span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">Y</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">k</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">v</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">Y</span></td></tr></table></blockquote></div><div class="SIntrapara">Extracts the value associated with a key from a mutable hash table; if
the key does not have an mapping, the third argument is used as the
value (or used to compute the value) and is added to the hash table
associated with the key.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">hsh</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'e 62) (cons 'r 1000) (cons 'b 70) (cons 'c 43)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-ref!</span><span class="hspace">&nbsp;</span><span class="RktSym">hsh</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">d</span><span class="hspace">&nbsp;</span><span class="RktVal">99</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">99</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">hsh</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'd 99) (cons 'e 62) (cons 'r 1000) (cons 'b 70) (cons 'c 43)))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-remove))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-remove%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-remove</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span><span class="RktVar">k</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">k</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs an immutable hash table with one less mapping than an
existing immutable hash table.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">ish</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hash (list (cons 'e 61) (cons 'r 999) (cons 'c 42) (cons 'b 69)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-remove</span><span class="hspace">&nbsp;</span><span class="RktSym">ish</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">b</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hash (list (cons 'e 61) (cons 'r 999) (cons 'c 42)))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-remove!))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-remove%21%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-remove!</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X</span></td></tr></table></blockquote></div><div class="SIntrapara">Removes an mapping from a mutable hash table.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">hsh</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'd 99) (cons 'e 62) (cons 'r 1000) (cons 'b 70) (cons 'c 43)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-remove!</span><span class="hspace">&nbsp;</span><span class="RktSym">hsh</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">r</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">hsh</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'd 99) (cons 'e 62) (cons 'b 70) (cons 'c 43)))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-set))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-set%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-set</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span><span class="RktVar">k</span><span class="hspace">&nbsp;</span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">k</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">v</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">Y</span></td></tr></table></blockquote></div><div class="SIntrapara">Constructs an immutable hash table with one new mapping from an
existing immutable hash table.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-set</span><span class="hspace">&nbsp;</span><span class="RktSym">ish</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">a</span><span class="hspace">&nbsp;</span><span class="RktVal">23</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hash (list (cons 'a 23) (cons 'e 61) (cons 'r 999) (cons 'c 42) (cons 'b 69)))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-set!))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-set%21%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-set!</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span><span class="RktVar">k</span><span class="hspace">&nbsp;</span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">k</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">v</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">Y</span></td></tr></table></blockquote></div><div class="SIntrapara">Updates a mutable hash table with a new mapping.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">hsh</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'd 99) (cons 'e 62) (cons 'b 70) (cons 'c 43)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-set!</span><span class="hspace">&nbsp;</span><span class="RktSym">hsh</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">a</span><span class="hspace">&nbsp;</span><span class="RktVal">23</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">hsh</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'd 99) (cons 'e 62) (cons 'a 23) (cons 'b 70) (cons 'c 43)))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-update))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-update%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-update</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span><span class="RktVar">k</span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">k</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">Y</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Composes hash-ref and hash-set to update an existing mapping; the third
argument is used to compute the new mapping value; the fourth
argument is used as the third argument to hash-ref.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-update</span><span class="hspace">&nbsp;</span><span class="RktSym">ish</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">b</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">lambda</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">old-b</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktSym">old-b</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hash (list (cons 'e 61) (cons 'r 999) (cons 'c 42) (cons 'b 70)))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash-update!))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash-update%21%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash-update!</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span><span class="RktVar">k</span><span class="hspace">&nbsp;</span><span class="RktVar">f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">void?</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">h</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">k</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">X</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">f</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">Y</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="nobreak">-&gt;</span></span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Composes hash-ref and hash-set! to update an existing mapping; the
third argument is used to compute the new mapping value; the fourth
argument is used as the third argument to hash-ref.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">hsh</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'd 99) (cons 'e 62) (cons 'a 23) (cons 'b 70) (cons 'c 43)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash-update!</span><span class="hspace">&nbsp;</span><span class="RktSym">hsh</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">b</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">lambda</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">old-b</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">+</span><span class="hspace">&nbsp;</span><span class="RktSym">old-b</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">&gt; </span><span class="RktSym">hsh</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'd 99) (cons 'e 62) (cons 'a 23) (cons 'b 71) (cons 'c 43)))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._hash~3f))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._hash~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym">boolean</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym">any</span></td></tr></table></blockquote></div><div class="SIntrapara">Determines if a value is a hash table.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktSym">ish</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hash (list (cons 'e 61) (cons 'r 999) (cons 'c 42) (cons 'b 69)))</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash?</span><span class="hspace">&nbsp;</span><span class="RktSym">ish</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#true</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">hash?</span><span class="hspace">&nbsp;</span><span class="RktVal">42</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#false</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._make-hash))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-hash%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-hash</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a mutable hash table from an optional list of mappings that
uses equal? for comparisons.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-hash</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-hash)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-hash</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">b</span><span class="hspace">&nbsp;</span><span class="RktVal">69</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">e</span><span class="hspace">&nbsp;</span><span class="RktVal">61</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">i</span><span class="hspace">&nbsp;</span><span class="RktVal">999</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-hash (list (cons 'e 61) (cons 'i 999) (cons 'b 69)))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._make-hasheq))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-hasheq%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-hasheq</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a mutable hash table from an optional list of mappings that
uses eq? for comparisons.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-hasheq</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-hasheq)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-hasheq</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">b</span><span class="hspace">&nbsp;</span><span class="RktVal">69</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">e</span><span class="hspace">&nbsp;</span><span class="RktVal">61</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">i</span><span class="hspace">&nbsp;</span><span class="RktVal">999</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-hasheq (list (cons 'b 69) (cons 'e 61) (cons 'i 999)))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._make-hasheqv))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-hasheqv%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-hasheqv</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Constructs a mutable hash table from an optional list of mappings that
uses eqv? for comparisons.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-hasheqv</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-hasheqv)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-hasheqv</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">b</span><span class="hspace">&nbsp;</span><span class="RktVal">69</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">e</span><span class="hspace">&nbsp;</span><span class="RktVal">61</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">i</span><span class="hspace">&nbsp;</span><span class="RktVal">999</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-hasheqv (list (cons 'b 69) (cons 'e 61) (cons 'i 999)))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._make-immutable-hash))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-immutable-hash%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-immutable-hash</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Constructs an immutable hash table from an optional list of mappings
that uses equal? for comparisons.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-immutable-hash</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hash)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-immutable-hash</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">b</span><span class="hspace">&nbsp;</span><span class="RktVal">69</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">e</span><span class="hspace">&nbsp;</span><span class="RktVal">61</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">i</span><span class="hspace">&nbsp;</span><span class="RktVal">999</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hash (list (cons 'e 61) (cons 'i 999) (cons 'b 69)))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._make-immutable-hasheq))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-immutable-hasheq%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-immutable-hasheq</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Constructs an immutable hash table from an optional list of mappings
that uses eq? for comparisons.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-immutable-hasheq</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hasheq)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-immutable-hasheq</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">b</span><span class="hspace">&nbsp;</span><span class="RktVal">69</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">e</span><span class="hspace">&nbsp;</span><span class="RktVal">61</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">i</span><span class="hspace">&nbsp;</span><span class="RktVal">999</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hasheq (list (cons 'e 61) (cons 'i 999) (cons 'b 69)))</span></p></td></tr></table></blockquote></div><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._htdp-advanced._((lib._lang/htdp-advanced..rkt)._make-immutable-hasheqv))"></a><span title="Provided from: lang/htdp-advanced | Package: htdp-lib"><span class="RktSym"><a href="#%28def._htdp-advanced._%28%28lib._lang%2Fhtdp-advanced..rkt%29._make-immutable-hasheqv%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-immutable-hasheqv</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">hash</span><span class="hspace">&nbsp;</span><span class="RktSym">X</span><span class="hspace">&nbsp;</span><span class="RktSym">Y</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Constructs an immutable hash table from an optional list of mappings
that uses eqv? for comparisons.
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-immutable-hasheqv</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hasheqv)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">make-immutable-hasheqv</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">b</span><span class="hspace">&nbsp;</span><span class="RktVal">69</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">e</span><span class="hspace">&nbsp;</span><span class="RktVal">61</span><span class="RktVal">)</span><span class="hspace">&nbsp;</span><span class="RktVal">(</span><span class="RktVal">i</span><span class="hspace">&nbsp;</span><span class="RktVal">999</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(make-immutable-hasheqv (list (cons 'e 61) (cons 'i 999) (cons 'b 69)))</span></p></td></tr></table></blockquote></div></p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" tabindex="1" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, &quot;7.7&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;7.7&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="intermediate-lam.html" title="backward to &quot;4 Intermediate Student with Lambda&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;How to Design Programs Languages&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<span class="nonavigation">next &rarr;</span></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>